mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-29 10:43:43 +01:00
Implement table.shallowcopy
This commit is contained in:
parent
98c702ee28
commit
d6774da79f
@ -72,6 +72,14 @@ end
|
|||||||
|
|
||||||
copy = tablecopy
|
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)
|
function deepcopy_noncircular(table)
|
||||||
local function _copy(value)
|
local function _copy(value)
|
||||||
if type(value) == "table" then
|
if type(value) == "table" then
|
||||||
|
Loading…
Reference in New Issue
Block a user