Implement table.shallowcopy

master
Lars Mueller 2020-12-01 19:29:18 +01:00
parent 98c702ee28
commit d6774da79f
1 changed files with 8 additions and 0 deletions

View File

@ -72,6 +72,14 @@ end
copy = tablecopy
function shallowcopy(table)
local copy = {}
for key, value in pairs(table) do
copy[key] = value
end
return copy
end
function deepcopy_noncircular(table)
local function _copy(value)
if type(value) == "table" then