Speed up colorless diff
This commit is contained in:
parent
1e58df6034
commit
3e86feb54c
|
@ -37,6 +37,12 @@ class FancyDiffer:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def diff_lines (l1, l2, colors=Colors.Null):
|
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)]
|
ss = [FancyDiffer.diff_regex.sub (r'\1\n\2\n', l).splitlines (True) for l in (l1, l2)]
|
||||||
oo = ["",""]
|
oo = ["",""]
|
||||||
st = [False, False]
|
st = [False, False]
|
||||||
|
|
Loading…
Reference in New Issue