# HG changeset patch # User Matthew Wild # Date 1457632377 0 # Node ID a9ef93bc81d903b34eee4b7b532af7de33fb7efc # Parent d8300985f2bb1654a6d60c9d8cc6752e952a7148 util.iterators: Variable renaming to avoid shadowing [luacheck] diff -r d8300985f2bb -r a9ef93bc81d9 util/iterators.lua --- a/util/iterators.lua Thu Mar 10 17:52:03 2016 +0000 +++ b/util/iterators.lua Thu Mar 10 17:52:57 2016 +0000 @@ -29,10 +29,10 @@ -- 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 @@ 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);