Comparison

util/iterators.lua @ 7258:b8f60dd8e99a

util.iterators: Return initial var from upstream iterator [luacheck]
author Matthew Wild <mwild1@gmail.com>
date Thu, 10 Mar 2016 17:49:46 +0000
parent 7257:425bc672d60b
child 7260:a9ef93bc81d9
comparison
equal deleted inserted replaced
7257:425bc672d60b 7258:b8f60dd8e99a
91 if c >= n then 91 if c >= n then
92 return nil; 92 return nil;
93 end 93 end
94 c = c + 1; 94 c = c + 1;
95 return f(s, var); 95 return f(s, var);
96 end, s; 96 end, s, var;
97 end 97 end
98 98
99 -- Skip the first n items an iterator returns 99 -- Skip the first n items an iterator returns
100 function it.skip(n, f, s, var) 100 function it.skip(n, f, s, var)
101 for i=1,n do 101 for i=1,n do