mirror of
https://github.com/appgurueu/modlib.git
synced 2025-02-18 09:03:46 +01:00
Implement table.shallowcopy
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user