chore: retry with old implementation of difference
This commit is contained in:
parent
a8788ca3b1
commit
b1c3eac1b9
@ -39,16 +39,16 @@ local function sizeof(t)
|
|||||||
return size
|
return size
|
||||||
end
|
end
|
||||||
|
|
||||||
local function difference(a, b)
|
function difference(a, b)
|
||||||
local ai = {}
|
local aa = {}
|
||||||
local r = {}
|
for k,v in pairs(a) do aa[v]=true end
|
||||||
|
for k,v in pairs(b) do aa[v]=nil end
|
||||||
for k,v in pairs(a) do r[k] = v; ai[v]=true end
|
local ret = {}
|
||||||
for k,v in pairs(b) do
|
local n = 0
|
||||||
if ai[v]~=nil then r[k] = nil end
|
for k,v in pairs(a) do
|
||||||
|
if aa[v] then n=n+1 ret[n]=v end
|
||||||
end
|
end
|
||||||
|
return ret
|
||||||
return r
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function shallowClone(t)
|
local function shallowClone(t)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user