3 ms·
Well, if you don't want to work with the whole sequence, you can filter it. But yeah, in those cases and some others, the for loop may be more idiomatic and bet
by Fargren 16y ago
Well, if you don't want to work with the whole sequence, you can filter it.
But yeah, in those cases and some others, the for loop may be more idiomatic and better performing.
- Dn_Ab 16y agoYes I'm talking about being able to stop early for one example. Or if the thing you are dealing with is not actually a sequence for another.
- darklajid 16y agoThe former can probably be solved for lots of cases by TakeWhile(), which evaluates before consuming more elements and could be used to replace "abort the loop" patterns. The latter is a different thing.. 1: http://msdn.microsoft.com/en-us/library/bb534804.aspx http://msdn.microsoft.com/en-us/library/bb534804.aspx
- deleted 16y ago[deleted]