Comparison

util/iterators.lua @ 7309:471189342890

util.iterators: Fix use of incorrect variable accidentally introduced in a9ef93bc81d9
author Matthew Wild <mwild1@gmail.com>
date Mon, 21 Mar 2016 21:04:14 +0000
parent 7260:a9ef93bc81d9
child 7351:11434c46b7b7
comparison
equal deleted inserted replaced
7306:98c4c3a2b536 7309:471189342890
133 function filter(x) return x ~= filter_value; end 133 function filter(x) return x ~= filter_value; end
134 end 134 end
135 return function (_s, _var) 135 return function (_s, _var)
136 local ret; 136 local ret;
137 repeat ret = pack(f(_s, _var)); 137 repeat ret = pack(f(_s, _var));
138 var = ret[1]; 138 _var = ret[1];
139 until var == nil or filter(unpack(ret, 1, ret.n)); 139 until _var == nil or filter(unpack(ret, 1, ret.n));
140 return unpack(ret, 1, ret.n); 140 return unpack(ret, 1, ret.n);
141 end, s, var; 141 end, s, var;
142 end 142 end
143 143
144 local function _ripairs_iter(t, key) if key > 1 then return key-1, t[key-1]; end end 144 local function _ripairs_iter(t, key) if key > 1 then return key-1, t[key-1]; end end