From 63d6d1a502ad62b46ff1c6517c87c4601d50be02 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 25 Sep 2011 00:21:22 +0100 Subject: util.array: Fix array.collect() for iterators that expect initial value of var to be preserved --- util/array.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') 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 -- cgit v1.2.3