mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 16:53:46 +01:00
Implement table.shallowcopy
This commit is contained in:
parent
98c702ee28
commit
d6774da79f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user