Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tcopy = nil;
- tcopy = function(from, to)
- for k, v in pairs(from) do
- if (type(v) == "table") then
- local dest = to[k];
- if (type(dest) ~= "table") then
- dest = {};
- to[k] = dest;
- end
- tcopy(v, dest);
- else
- to[k] = v;
- end
- end
- end
- tclone = function(t)
- local result = {};
- tcopy(t, {});
- return result;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement