mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 06:04:35 +00:00
fixed possible stack overflow in deep_copy
This commit is contained in:
parent
a5c26038df
commit
81512550bb
@ -361,11 +361,11 @@ local function _deep_copy_impl(t, already_copied)
|
||||
else
|
||||
--a plain table to clone
|
||||
clone = {}
|
||||
already_copied[t] = clone
|
||||
for k, v in pairs(t) do
|
||||
clone[k] = _deep_copy_impl(v, already_copied)
|
||||
end
|
||||
setmetatable(clone, getmetatable(t))
|
||||
already_copied[t] = clone
|
||||
end
|
||||
end
|
||||
return clone
|
||||
|
Loading…
Reference in New Issue
Block a user