mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-12-01 02:23:59 +01:00
Speed up colorless diff
This commit is contained in:
1 parent
1e58df6034
commit
3e86feb54c
1 file changed
+6
@@ -37,6 +37,12 @@ class FancyDiffer:
|
||||
@staticmethod
|
||||
def diff_lines (l1, l2, colors=Colors.Null):
|
||||
|
||||
# Easy without colors
|
||||
if colors == Colors.Null:
|
||||
if l1 == l2:
|
||||
return [' ', l1]
|
||||
return ['-', l1, '+', l2]
|
||||
|
||||
ss = [FancyDiffer.diff_regex.sub (r'\1\n\2\n', l).splitlines (True) for l in (l1, l2)]
|
||||
oo = ["",""]
|
||||
st = [False, False]
|
||||
|
||||
Reference in new issue
Block a user