From 4443dc9d3e3a0d1a4ee52f0fd8805c2ffb98aae6 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 13 Nov 2021 17:29:17 +0800 Subject: [PATCH] =?UTF-8?q?table=E6=89=A9=E5=B1=95=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E4=B8=AA=E6=96=B9=E6=B3=95=EF=BC=88?= =?UTF-8?q?=E6=9C=AA=E6=9D=A5=E4=BC=9A=E6=95=B4=E7=90=86=E7=B1=BB=E4=BC=BC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A1=A8=E6=9B=B4=E6=96=B0=E5=87=BD=E6=95=B0?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/tableExtend.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Zframework/tableExtend.lua b/Zframework/tableExtend.lua index fbb201ca..85858728 100644 --- a/Zframework/tableExtend.lua +++ b/Zframework/tableExtend.lua @@ -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