@@ -30,7 +30,7 @@ function util.deepcompare(t1,t2,ignore_mt,cycles,thresh1,thresh2)
3030 cycles [1 ][t1 ] = cycles [1 ][t1 ] + 1
3131 cycles [2 ][t2 ] = cycles [2 ][t2 ] + 1
3232
33- for k1 ,v1 in pairs ( t1 ) do
33+ for k1 ,v1 in next , t1 do
3434 local v2 = t2 [k1 ]
3535 if v2 == nil then
3636 return false , {k1 }
@@ -43,7 +43,7 @@ function util.deepcompare(t1,t2,ignore_mt,cycles,thresh1,thresh2)
4343 return false , crumbs
4444 end
4545 end
46- for k2 ,_ in pairs ( t2 ) do
46+ for k2 ,_ in next , t2 do
4747 -- only check wether each element has a t1 counterpart, actual comparison
4848 -- has been done in first loop above
4949 if t1 [k2 ] == nil then return false , {k2 } end
5858function util .shallowcopy (t )
5959 if type (t ) ~= " table" then return t end
6060 local copy = {}
61- for k ,v in next , t , nil do
61+ for k ,v in next , t do
6262 copy [k ] = v
6363 end
6464 return copy
@@ -74,7 +74,7 @@ function util.deepcopy(t, deepmt, cache)
7474 if cache [t ] then return cache [t ] end
7575 cache [t ] = copy
7676
77- for k ,v in next , t , nil do
77+ for k ,v in next , t do
7878 copy [k ] = (spy .is_spy (v ) and v or util .deepcopy (v , deepmt , cache ))
7979 end
8080 if deepmt then
0 commit comments