Commit 49a90223 authored by Anton Bukov's avatar Anton Bukov

Fix skip and skipWhile

parent 8f5f8cff
......@@ -141,7 +141,8 @@ namespace boolinq {
}
while (true) {
T ret = tuple.linq.next();
if (predicate(ret, tuple.index++)) {
if (!predicate(ret, tuple.index++)) {
tuple.flag = true;
return ret;
}
}
......@@ -509,7 +510,7 @@ namespace boolinq {
T elementAt(int index) const
{
return skip(index - 1).next();
return skip(index).next();
}
template<typename F>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment