refactor deepComparison

This commit is contained in:
neckrat 2026-04-23 22:11:15 +03:00
parent 77f5a2abdc
commit 8cbaf643ab

View File

@ -81,9 +81,8 @@ end
function P.deepComparison(t1, t2) function P.deepComparison(t1, t2)
for k, v in pairs(t1) do for k, v in pairs(t1) do
if type(v) == "table" and type(t2[k]) == "table" then if type(v) == "table" and type(t2[k]) == "table" then
return P.deepComparison(v, t2[k]) if not P.deepComparison(v, t2[k]) then return false end
end elseif t2[k] ~= v then
if t2[k] ~= v then
return false return false
end end
end end