summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/l-table.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-06-04 17:42:38 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-06-04 17:42:38 +0200
commit32f8047624c2fa49c3031a66edb5a039a813f276 (patch)
treed568ec496e3b4c95adc37ce435b0161a3f40c581 /tex/context/base/mkiv/l-table.lua
parent3ab20dbdfa095edd8c6bc00b8e3bdccd78900257 (diff)
downloadcontext-32f8047624c2fa49c3031a66edb5a039a813f276.tar.gz
2017-06-04 17:01:00
Diffstat (limited to 'tex/context/base/mkiv/l-table.lua')
-rw-r--r--tex/context/base/mkiv/l-table.lua22
1 files changed, 13 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/l-table.lua b/tex/context/base/mkiv/l-table.lua
index 3c1ce6daf..5bfc4bc47 100644
--- a/tex/context/base/mkiv/l-table.lua
+++ b/tex/context/base/mkiv/l-table.lua
@@ -1092,7 +1092,9 @@ function table.unnest(t) -- bad name
end
local function are_equal(a,b,n,m) -- indexed
- if a and b and #a == #b then
+ if a == b then
+ return true
+ elseif a and b and #a == #b then
n = n or 1
m = m or #a
for i=n,m do
@@ -1114,16 +1116,18 @@ local function are_equal(a,b,n,m) -- indexed
end
local function identical(a,b) -- assumes same structure
- for ka, va in next, a do
- local vb = b[ka]
- if va == vb then
- -- same
- elseif type(va) == "table" and type(vb) == "table" then
- if not identical(va,vb) then
+ if a ~= b then
+ for ka, va in next, a do
+ local vb = b[ka]
+ if va == vb then
+ -- same
+ elseif type(va) == "table" and type(vb) == "table" then
+ if not identical(va,vb) then
+ return false
+ end
+ else
return false
end
- else
- return false
end
end
return true