|
|
|
@ -14,10 +14,18 @@ function table.dump(t, depth)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function table.copy(t)
|
|
|
|
|
local res = {}
|
|
|
|
|
for k,v in pairs(t) do
|
|
|
|
|
res[k] = v
|
|
|
|
|
end
|
|
|
|
|
return res
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function table.recursivecopy(t)
|
|
|
|
|
local res = {}
|
|
|
|
|
for k,v in pairs(t) do
|
|
|
|
|
if type(v) == "table" then
|
|
|
|
|
res[k] = table.copy(v)
|
|
|
|
|
res[k] = table.recursivecopy(v)
|
|
|
|
|
else
|
|
|
|
|
res[k] = v
|
|
|
|
|
end
|
|
|
|
@ -83,4 +91,4 @@ function table.empty(t)
|
|
|
|
|
return next(t) == nil
|
|
|
|
|
end
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|