Skip to content

Remove unnecessary check in VecDeque::grow #91339

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
Dec 3, 2021

Conversation

cbarrete
Copy link
Contributor

All callers already check that the buffer is full before calling
grow(). This is where it makes the most sense, since grow() is
inline(never) and we don't want to pay for a function call just for
that check.
It could also be argued that it would be correct to call grow() even
if the buffer wasn't full yet.
This change breaks no code since grow() is not pub.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 28, 2021
@rust-log-analyzer

This comment has been minimized.

@cbarrete cbarrete force-pushed the vecdeque-remove-grow-check branch from 3186b79 to fb50b61 Compare November 28, 2021 23:26
All callers already check that the buffer is full before calling
`grow()`. This is where it makes the most sense, since `grow()` is
`inline(never)` and we don't want to pay for a function call just for
that check.
It could also be argued that it would be correct to call `grow()` even
if the buffer wasn't full yet.
This change breaks no code since `grow()` is not `pub`.
@cbarrete cbarrete force-pushed the vecdeque-remove-grow-check branch from fb50b61 to 29f5c98 Compare November 30, 2021 02:14
@apiraino apiraino added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Dec 1, 2021
@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Dec 2, 2021

📌 Commit 29f5c98 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 2, 2021
@bors
Copy link
Collaborator

bors commented Dec 3, 2021

⌛ Testing commit 29f5c98 with merge 190367b...

@bors
Copy link
Collaborator

bors commented Dec 3, 2021

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 190367b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 3, 2021
@bors bors merged commit 190367b into rust-lang:master Dec 3, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 3, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (190367b): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants