Skip to content

Commit bf3023e

Browse files
committed
Remove matches that aren't further right than the one before it.
1 parent 87b0d08 commit bf3023e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

xtra/DIFF.LUA

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ local function diff_u(fn1,fn2)
3434
for _,v in ipairs(u.l) do print(v)end end u=nil end
3535
local function init()if not u then local k,l=math.max(i-3,1),math.max(j-3,1)u={e=0,l={},o={s=k,l=0},n={s=l,l=0}}
3636
for z=k,i-1 do table.insert(u.l,pfl(" ",get(fn1,f1,z)))u.o.l,u.n.l=u.o.l+1,u.n.l+1 end end end
37+
local k=2 while k<=#m do if m[k].x>m[k-1].x then table.remove(m,k-1)else k=k+1 end end
3738
for _,p in ipairs(m)do
3839
while i<p.x do init()table.insert(u.l,pfl("-",get(fn1,f1,i)))i,u.o.l,u.e=i+1,u.o.l+1,0 end
3940
while j<p.y do init()table.insert(u.l,pfl("+",get(fn2,f2,j)))j,u.n.l,u.e=j+1,u.n.l+1,0 end

0 commit comments

Comments
 (0)