# HG changeset patch # User Matthew Wild # Date 1316906482 -3600 # Node ID 06161b0b83f272a6537790dfe5dbf7e6ff668c57 # Parent ce769240f8ec464092e9f0640e4a440aa3f1ec83 util.array: Fix array.collect() for iterators that expect initial value of var to be preserved diff -r ce769240f8ec -r 06161b0b83f2 util/array.lua --- 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