From 0cae74cbb2955533812c0772f8a2910326b64962 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 10 Mar 2016 17:52:57 +0000 Subject: util.iterators: Variable renaming to avoid shadowing [luacheck] --- util/iterators.lua | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'util') diff --git a/util/iterators.lua b/util/iterators.lua index 99b5f090..d453a694 100644 --- a/util/iterators.lua +++ b/util/iterators.lua @@ -29,10 +29,10 @@ function it.reverse(f, s, var) -- Then return our reverse one local i,max = 0, #results; - return function (results) + return function (_results) if i= n then return nil; end c = c + 1; - return f(s, var); + return f(_s, _var); end, s, var; end -- Skip the first n items an iterator returns function it.skip(n, f, s, var) - for i=1,n do + for _ = 1, n do var = f(s, var); end return f, s, var; @@ -132,9 +132,9 @@ function it.filter(filter, f, s, var) local filter_value = filter; function filter(x) return x ~= filter_value; end end - return function (s, var) + return function (_s, _var) local ret; - repeat ret = pack(f(s, var)); + repeat ret = pack(f(_s, _var)); var = ret[1]; until var == nil or filter(unpack(ret, 1, ret.n)); return unpack(ret, 1, ret.n); -- cgit v1.2.3