Skip to content

Commit e89bc36

Browse files
committed
Put basic statements on the same line in diagonal(), right() & down().
1 parent 2d80f02 commit e89bc36

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

demo/xtra/DIFF.LUA

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,16 @@ local function diff_u(fn1,fn2)
1414
local function diagonal()
1515
flush_hunks()
1616
if #pre >= 3 then table.remove(pre, 1) end
17-
if #pre <= 0 and post > 0 then
18-
print(" " .. l2) post = post - 1
19-
else
20-
table.insert(pre, l2)
21-
end
22-
x, y = x + 1, y + 1
23-
l1, l2 = f1:read("*l"), f2:read("*l")
17+
if #pre <= 0 and post > 0 then print(" " .. l2) post = post - 1 else table.insert(pre, l2) end
18+
x, y, l1, l2 = x + 1, y + 1, f1:read("*l"), f2:read("*l")
2419
end
2520
local function right()
26-
flush_pre()
27-
post = 3
21+
flush_pre() post = 3
2822
table.insert(del, l1)
2923
l1 = f1:read("*l")
3024
end
3125
local function down()
32-
flush_pre()
33-
post = 3
26+
flush_pre() post = 3
3427
table.insert(add, l2)
3528
l2 = f2:read("*l")
3629
end

0 commit comments

Comments
 (0)