mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 16:53:46 +01:00
table.deep_to_add: Don't emit empty subtables
This commit is contained in:
parent
187723118c
commit
ea9197c571
@ -489,7 +489,10 @@ function deep_to_add(table, after_additions)
|
|||||||
local additions = {}
|
local additions = {}
|
||||||
for key, value in pairs(after_additions) do
|
for key, value in pairs(after_additions) do
|
||||||
if type(table[key]) == "table" and type(value) == "table" then
|
if type(table[key]) == "table" and type(value) == "table" then
|
||||||
additions[key] = deep_to_add(table[key], value)
|
local sub_additions = deep_to_add(table[key], value)
|
||||||
|
if next(sub_additions) ~= nil then
|
||||||
|
additions[key] = sub_additions
|
||||||
|
end
|
||||||
elseif table[key] ~= value then
|
elseif table[key] ~= value then
|
||||||
additions[key] = value
|
additions[key] = value
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user