Don't collect to vectors where unnecessary#55048
Merged
bors merged 1 commit intorust-lang:masterfrom Oct 15, 2018
Merged
Conversation
Contributor
|
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc_traits/lowering.rs
Outdated
Member
There was a problem hiding this comment.
Hm, isn't this cloning the underlying vector?
Contributor
Author
There was a problem hiding this comment.
I thought this only clones the Iter struct, i.e. only the start and end pointer (and the marker)?
Member
There was a problem hiding this comment.
where_clause is an into_iter struct, not an iter struct which is why I think this will copy the vector.
Contributor
Author
There was a problem hiding this comment.
Ah, you're right; luckily, there is still room for improvement - I'll update the PR shortly.
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit 12b5c7b has been approved by |
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Oct 15, 2018
Don't collect to vectors where unnecessary This removes 3 vector allocations and a call to `cloned()`.
bors
added a commit
that referenced
this pull request
Oct 15, 2018
Rollup of 11 pull requests Successful merges: - #54820 (Closes #54538: `unused_patterns` lint) - #54963 (Cleanup rustc/session) - #54991 (add test for #23189) - #55025 (Add missing lifetime fragment specifier to error message.) - #55047 (doc: make core::fmt::Error example more simple) - #55048 (Don't collect to vectors where unnecessary) - #55060 (clarify pointer add/sub function safety concerns) - #55062 (Make EvalContext::step public again) - #55066 (Fix incorrect link in println! documentation) - #55081 (Deduplicate tests) - #55088 (Update rustc documentation link) Failed merges: r? @ghost
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 free
to 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.
This removes 3 vector allocations and a call to
cloned().