« Introduction | Main | Partial Function Application (Schnfinkelisation) in C# »

June 27, 2008

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00e5536ed793883300e55372e7ba8833

Listed below are links to weblogs that reference IEnumberable<T> WhereFew:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Aaron, TakeWhile does not allow you to terminate enumerating early based on a predicate. It will stop enumerating as soon as the predicate passed to it returns false. WhereFew will enumerate until it finds data to match the predicate and terminate when it stops finding matches and it will also terminate early if it gets to the point where it can not find data to satisfy the predicate. The key different being that data sent to WhereFew should be sorted based on the predicate to ensure it behaves as expected. The two are similar above the covers, but have different applications. Thanks for commenting!

The comments to this entry are closed.