Diff

util/array.lua @ 4387:06161b0b83f2

util.array: Fix array.collect() for iterators that expect initial value of var to be preserved
author Matthew Wild <mwild1@gmail.com>
date Sun, 25 Sep 2011 00:21:22 +0100
parent 3540:bc139431830b
child 4439:1c8d2c0d02db
line wrap: on
line diff
--- a/util/array.lua	Sun Sep 25 00:20:43 2011 +0100
+++ b/util/array.lua	Sun Sep 25 00:21:22 2011 +0100
@@ -98,7 +98,7 @@
 
 --- 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