Skip to content

Avoid multiple enumeration of IEnumerable PostData #4428

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

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Feb 24, 2020

This commit updates PostData to use the enumerator to
enumerate IEnumerable or IEnumerable,
avoiding enumerating twice, once when checking .Any() and again
when calling foreach.

Closes #4388

This commit updates PostData to use the enumerator to
enumerate IEnumerable<string> or IEnumerable<object>,
avoiding enumerating twice, once when checking .Any() and again
when calling foreach.

Closes #4388
@russcam russcam merged commit f3f8466 into master Feb 24, 2020
@russcam russcam deleted the fix/master/enumerable-iteration branch February 24, 2020 05:16
github-actions bot pushed a commit that referenced this pull request Feb 24, 2020
This commit updates PostData to use the enumerator to
enumerate IEnumerable<string> or IEnumerable<object>,
avoiding enumerating twice, once when checking .Any() and again
when calling foreach.

Closes #4388
github-actions bot pushed a commit that referenced this pull request Feb 24, 2020
This commit updates PostData to use the enumerator to
enumerate IEnumerable<string> or IEnumerable<object>,
avoiding enumerating twice, once when checking .Any() and again
when calling foreach.

Closes #4388
russcam added a commit that referenced this pull request Feb 24, 2020
This commit updates PostData to use the enumerator to
enumerate IEnumerable<string> or IEnumerable<object>,
avoiding enumerating twice, once when checking .Any() and again
when calling foreach.

Closes #4388

Co-authored-by: Russ Cam <russ.cam@elastic.co>
russcam added a commit that referenced this pull request Feb 24, 2020
This commit updates PostData to use the enumerator to
enumerate IEnumerable<string> or IEnumerable<object>,
avoiding enumerating twice, once when checking .Any() and again
when calling foreach.

Closes #4388

Co-authored-by: Russ Cam <russ.cam@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question: Multiple iteration of IEnumerable
2 participants