Uh oh!
There was an error while loading. Please reload this page.
Optimise Chars::last() - #37882
Merged
Merged
Conversation
The default implementation of last() goes through the entire iterator but that's not needed here.
rust-highfive
commented
Nov 19, 2016
Contributor
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
bluss
commented
Nov 19, 2016
Contributor
@bors r+ rollup Thank you! |
bors
commented
Nov 19, 2016
Collaborator
📌 Commit de2f617 has been approved by |
bluss
commented
Nov 19, 2016
Contributor
By the way, this applies to char_indices as well. Another commit or another PR is welcome. |
The default implementation of last() goes through the entire iterator but that's not needed here.
ollie27
commented
Nov 20, 2016
ContributorAuthor
Good point. I've applied the same to |
bluss
commented
Nov 20, 2016
Contributor
@bors r+ rollup |
bors
commented
Nov 20, 2016
Collaborator
📌 Commit 9e86e18 has been approved by |
GuillaumeGomez added a commit
to GuillaumeGomez/rust
that referenced
this pull request
Nov 20, 2016
Optimise Chars::last() The default implementation of last() goes through the entire iterator but that's not needed here.
bors added a commit
that referenced
this pull request
Nov 20, 2016
durka
commented
Nov 25, 2016
Contributor
Shouldn't this apply to any |
ollie27
commented
Nov 25, 2016
ContributorAuthor
Yeah, but I think it might be breaking change to do this for iterators that might have side effects. |
bluss
commented
Nov 25, 2016
Contributor
Yes. Iterator::last's doc is specific about how it goes about finding the last value (traversing it all). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default implementation of last() goes through the entire iterator
but that's not needed here.