aboutsummaryrefslogtreecommitdiff
path: root/utils.lua
diff options
context:
space:
mode:
Diffstat (limited to 'utils.lua')
-rw-r--r--utils.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils.lua b/utils.lua
index 80585a5..937252f 100644
--- a/utils.lua
+++ b/utils.lua
@@ -284,7 +284,7 @@ local function sort(list, keyFn, reverse)
end
local function equivalent(x, y, depth)
- depth = depth or 1
+ depth = depth or -1
if x == y then
return true
end
@@ -296,6 +296,8 @@ local function equivalent(x, y, depth)
end
if depth == 0 then
return false
+ elseif depth < -999 then
+ error("Exceeded maximum comparison depth")
end
local checked = {}
for k, v in pairs(x) do