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

Reduce allocations caused by Range operators on arrays and strings #46519

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Feb 8, 2023

Using the Range operator on an array or string causes a new array or string allocation, which may not be necessary. In these cases, we don't need to allocate an intermediate array or string, and can just use a span instead.

Fixed minor spelling mistakes in adjacent code.

Using the Range operator on an array or string causes a new array or string allocation, which may not be necessary. In these cases, we don't need to allocate an intermediate array or string, and can just use a span instead.

Fixed minor spelling mistakes in adjacent code.
@eerhardt eerhardt enabled auto-merge (squash) February 8, 2023 20:57
@eerhardt eerhardt merged commit a4bbcba into dotnet:main Feb 9, 2023
@ghost ghost added this to the 8.0-preview2 milestone Feb 9, 2023
@eerhardt eerhardt deleted the ReduceAllocations branch April 28, 2023 19:24
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.

3 participants