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

IEnumerable<T> serialize improvement: Enumerable.TryGetNonEnumeratedCount #1751

Merged

Conversation

pCYSl5EDgo
Copy link
Contributor

@pCYSl5EDgo pCYSl5EDgo commented Jan 28, 2024

Enumerable.TryGetNonEnumeratedCount is efficient API for getting Count when dealing with IEnumerable<T>.
IEnumerable<T> generated by LINQ can be more efficiently counted since this API can access dotnet's internal interface IIListProvider<T>'s GetCount method.

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This looks like a good change.

@AArnott AArnott merged commit f29991b into MessagePack-CSharp:develop Jan 28, 2024
4 of 5 checks passed
@pCYSl5EDgo pCYSl5EDgo deleted the net6-TryGetNonEnumeratedCount branch January 28, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants