aboutsummaryrefslogtreecommitdiffstats
path: root/util/array.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-09-25 00:21:22 +0100
committerMatthew Wild <mwild1@gmail.com>2011-09-25 00:21:22 +0100
commit937263b7a5070a8f6bc8256004b9ecce68f0a27a (patch)
treeae5ee40de1cb4e756425585c92e8fe6db2bf8bbe /util/array.lua
parent022ff52b65f323884932972688ae195e65f1e8eb (diff)
downloadprosody-937263b7a5070a8f6bc8256004b9ecce68f0a27a.tar.gz
prosody-937263b7a5070a8f6bc8256004b9ecce68f0a27a.zip
util.array: Fix array.collect() for iterators that expect initial value of var to be preserved
Diffstat (limited to 'util/array.lua')
-rw-r--r--util/array.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/array.lua b/util/array.lua
index 6c1f0460..5dbd3037 100644
--- a/util/array.lua
+++ b/util/array.lua
@@ -98,7 +98,7 @@ array_methods.length = function (t) return #t; end
--- These methods always create a new array
function array.collect(f, s, var)
- local t, var = {};
+ local t = {};
while true do
var = f(s, var);
if var == nil then break; end