Fix table.difference (fix for cellestial)

This commit is contained in:
Lars Mueller 2021-01-02 12:30:27 +01:00
parent d0317cc5d8
commit 0eb59a85bf

@ -288,16 +288,18 @@ end
contains = find contains = find
function difference(table, other_table) function to_add(table, after_additions)
local result = {} local additions = {}
for key, value in pairs(other_table) do for key, value in pairs(after_additions) do
if table[value] ~= value then if table[key] ~= value then
result[key] = value additions[key] = value
end end
end end
return result return additions
end end
difference = to_add
function add_all(table, additions) function add_all(table, additions)
for key, value in pairs(additions) do for key, value in pairs(additions) do
table[key] = value table[key] = value