3 ms·
> each of them takes another pass through the sequence Not necessarily. In C# (LINQ) you have deferred execution / lazy evaluation, when possible of course - i
by V-2 11y ago
> each of them takes another pass through the sequence
Not necessarily. In C# (LINQ) you have deferred execution / lazy evaluation, when possible of course - it's possible for filtering, not possible for a group-by, but that's just reality.
Combine it with yield-return pattern, and it's very easy to avoid the problem you brought up.