Skip to content

Commit

Permalink
Simplifying skipWhile_i
Browse files Browse the repository at this point in the history
  • Loading branch information
k06a committed Jun 30, 2013
1 parent 1a168d3 commit 23f54ad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions boolinq/boolinq.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace boolinq
return where_i([=](T, int i){return i >= count;});
}

LinqObj<Enumerator<T,std::pair<TE,int> > > skipWhile_i(std::function<bool(T,int)> predicate) const
LinqObj<TE> skipWhile_i(std::function<bool(T,int)> predicate) const
{
auto enumerator = _enumerator;

Expand All @@ -202,12 +202,10 @@ namespace boolinq
}
catch(EnumeratorEndException &){}

return Enumerator<T,std::pair<TE,int> >([=](std::pair<TE,int> & pair)->T{
return pair.first.nextObject();
}, std::make_pair(enumerator,0));
return enumerator;
}

LinqObj<Enumerator<T,std::pair<TE,int> > > skipWhile(std::function<bool(T)> predicate) const
LinqObj<TE> skipWhile(std::function<bool(T)> predicate) const
{
return skipWhile_i([=](T t, int /*i*/){ return predicate(t);});
}
Expand Down

0 comments on commit 23f54ad

Please sign in to comment.