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

Optimize for loops over spans #6195

Closed
forki opened this issue Feb 5, 2019 · 1 comment
Closed

Optimize for loops over spans #6195

forki opened this issue Feb 5, 2019 · 1 comment
Milestone

Comments

@forki
Copy link
Contributor

forki commented Feb 5, 2019

Consider the following example:

let x : Span<'T> = ...
for item in x do
    ...

Using the for loop against the span x, it will use the enumerator to iterate. This is inefficient and can be optimized by the compiler to simply iterate by the indexer.

@cartermp
Copy link
Contributor

Completed.

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

3 participants