Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan should not throw on empty sequences #97

Open
GoogleCodeExporter opened this issue Apr 7, 2015 · 0 comments
Open

Scan should not throw on empty sequences #97

GoogleCodeExporter opened this issue Apr 7, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 30 Dec 2014 at 1:15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant