Skip to content
Snippets Groups Projects
Commit 881ed6a4 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

mdiff: compute newlines-splitted texts within _unidiff

There is no reason to compute splitted texts l1, l2 in unidiff() before
calling _unidiff as they are only used with the latter function.
parent 8089de5f
No related branches found
No related tags found
No related merge requests found
......@@ -240,9 +240,7 @@
l3 = "@@ -1,%d +0,0 @@\n" % len(a)
l = [l1, l2, l3] + ["-" + e for e in a]
else:
al = splitnewlines(a)
bl = splitnewlines(b)
l = list(_unidiff(a, b, al, bl, opts=opts))
l = list(_unidiff(a, b, opts=opts))
if not l:
return ""
......@@ -257,8 +255,9 @@
# creates a headerless unified diff
# t1 and t2 are the text to be diffed
# l1 and l2 are the text broken up into lines
def _unidiff(t1, t2, l1, l2, opts=defaultopts):
def _unidiff(t1, t2, opts=defaultopts):
l1 = splitnewlines(t1)
l2 = splitnewlines(t2)
def contextend(l, len):
ret = l + opts.context
if ret > len:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment