faithword / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

Scan should not throw on empty sequences #97

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The Scan<T> implementation throws when an empty sequence is found. I believe 
the correct behavior should be to yield break in that case.

This would mean a different behavior from the Scan<T, TState> implementation, 
but it is already different. Without a seed, an IEnumerable of size N will 
yield an IEnumerable of the same size, while the version with seed adds an 
extra element.

So making a 0-length IEnumerable result in a 0-length IEnumerable seems like 
the right behavior to me.

Original issue reported on code.google.com by fsate...@gmail.com on 30 Dec 2014 at 1:15

GoogleCodeExporter commented 9 years ago
This issue has been migrated to:
https://github.com/MoreLINQ/morelinq/issues/97
The conversation continues there.
DO NOT post any further comments to the issue tracker on Google Code as it is 
shutting down.
You can also just subscribe to the issue on GitHub to receive notifications of 
any further development.

Original comment by azizatif on 21 Aug 2015 at 6:56