Skip to content

Minor optimization for VecMap::split_off #25301

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

Merged
merged 1 commit into from
May 11, 2015

Conversation

jooert
Copy link
Contributor

@jooert jooert commented May 11, 2015

We don't need to copy any elements if at is behind the last element
in the map. The last element is at index self.v.len() - 1, so we
should not copy if at is greater or equals self.v.len().

r? @gankro

We don't need to copy any elements if `at` is behind the last element
in the map. The last element is at index `self.v.len() - 1`, so we
should not copy if `at` is greater or equals `self.v.len()`.
@Gankra
Copy link
Contributor

Gankra commented May 11, 2015

r+ rollup

@Gankra
Copy link
Contributor

Gankra commented May 11, 2015

err

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 11, 2015

📌 Commit 5b0e197 has been approved by Gankro

bors added a commit that referenced this pull request May 11, 2015
We don't need to copy any elements if `at` is behind the last element
in the map. The last element is at index `self.v.len() - 1`, so we
should not copy if `at` is greater **or equals** `self.v.len()`.

r? @gankro
@bors
Copy link
Collaborator

bors commented May 11, 2015

⌛ Testing commit 5b0e197 with merge 0a41c4a...

@bors bors merged commit 5b0e197 into rust-lang:master May 11, 2015
@jooert jooert deleted the vec_map_fix_split_off branch May 11, 2015 18:52
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