table扩展模块添加一个方法(未来会整理类似数据表更新函数)

This commit is contained in:
MrZ626
2021-11-13 17:29:17 +08:00
parent 839e357301
commit 4443dc9d3e

View File

@@ -46,6 +46,18 @@ function TABLE.cover(new,old)
end
end
--For all things in new, push to old
function TABLE.coverR(new,old)
for k,v in next,new do
if type(v)=='table'and type(old[k])=='table'then
TABLE.coverR(v,old[k])
else
old[k]=v
end
end
end
--For all things in new if same type in old, push to old
function TABLE.update(new,old)
for k,v in next,new do