aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-03-16 23:49:27 +0100
committerKim Alvefur <zash@zash.se>2017-03-16 23:49:27 +0100
commit3601968ff85a10f18f1dba92360aac7efabe09ad (patch)
tree5d9e9dfec7020f862dc40a4b872556e3661b5327 /util
parent33f73b5b885da18cef1b983cd1a1fe6d287e0391 (diff)
parent4ce8edd6eb83eff68970077e9c3c99df19f5a955 (diff)
downloadprosody-3601968ff85a10f18f1dba92360aac7efabe09ad.tar.gz
prosody-3601968ff85a10f18f1dba92360aac7efabe09ad.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/array.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/util/array.lua b/util/array.lua
index ea520f6b..05fa97ca 100644
--- a/util/array.lua
+++ b/util/array.lua
@@ -33,6 +33,19 @@ function array_mt.__add(a1, a2)
return res:append(a1):append(a2);
end
+function array_mt.__eq(a, b)
+ if #a == #b then
+ for i = 1, #a do
+ if a[i] ~= b[i] then
+ return false;
+ end
+ end
+ else
+ return false;
+ end
+ return true;
+end
+
setmetatable(array, { __call = new_array });
-- Read-only methods