Advertisement
Dramiel

RIFT Clone table

Nov 8th, 2011
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.22 KB | None | 0 0
  1. --[[
  2.     Cloning
  3. ]]
  4. clone = function(source)
  5.     if (type(source) ~= "table") then
  6.         return source;
  7.     end
  8.  
  9.     local result = { };
  10.  
  11.     for k, v in pairs(source) do
  12.         result[clone(k)] = clone(v);
  13.     end
  14.  
  15.     return result;
  16. end
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement