KEMBAR78
Remove Current interface call in IteratorSelectIterator by stephentoub · Pull Request #99344 · dotnet/runtime · GitHub
Skip to content

Conversation

@stephentoub
Copy link
Member

By returning Iterator<> from GetEnumerator, strongly-typed callers (such as those in IteratorSelectIterator) can bind to the non-virtual Current member, saving an interface/virtual call. The interface dispatch to MoveNext also becomes virtual for such callers.

By returning `Iterator<>` from GetEnumerator, strongly-typed callers (such as those in IteratorSelectIterator) can bind to the non-virtual Current member, saving an interface/virtual call. The interface dispatch to MoveNext also becomes virtual for such callers.
@ghost
Copy link

ghost commented Mar 6, 2024

Tagging subscribers to this area: @dotnet/area-system-linq
See info in area-owners.md if you want to be subscribed.

Issue Details

By returning Iterator<> from GetEnumerator, strongly-typed callers (such as those in IteratorSelectIterator) can bind to the non-virtual Current member, saving an interface/virtual call. The interface dispatch to MoveNext also becomes virtual for such callers.

Author: stephentoub
Assignees: -
Labels:

area-System.Linq

Milestone: -

@ghost ghost assigned stephentoub Mar 6, 2024
@stephentoub stephentoub merged commit ef339ba into dotnet:main Mar 6, 2024
@stephentoub stephentoub deleted the selectiterator branch March 6, 2024 12:53
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants