<span style="font-family: Arial, Helvetica, sans-serif;">-- 拷贝table</span>
function copy_table(ori_tab)
if type(ori_tab) ~= "table" then
return
end
local new_tab = {}
for k, v in pairs(ori_tab) do
local vtype = type(v)
if vtype == "table" then
new_tab[k] = copy_table[v]
else
new_tab[k] = v
end
end
return new_tab
end
此函数摘自http://www.cnblogs.com/zuibunan/p/3954522.html