mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-29 10:43:43 +01:00
Fix table.difference (fix for cellestial)
This commit is contained in:
parent
d0317cc5d8
commit
0eb59a85bf
14
table.lua
14
table.lua
@ -288,16 +288,18 @@ end
|
||||
|
||||
contains = find
|
||||
|
||||
function difference(table, other_table)
|
||||
local result = {}
|
||||
for key, value in pairs(other_table) do
|
||||
if table[value] ~= value then
|
||||
result[key] = value
|
||||
function to_add(table, after_additions)
|
||||
local additions = {}
|
||||
for key, value in pairs(after_additions) do
|
||||
if table[key] ~= value then
|
||||
additions[key] = value
|
||||
end
|
||||
end
|
||||
return result
|
||||
return additions
|
||||
end
|
||||
|
||||
difference = to_add
|
||||
|
||||
function add_all(table, additions)
|
||||
for key, value in pairs(additions) do
|
||||
table[key] = value
|
||||
|
Loading…
Reference in New Issue
Block a user