-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
Conversation
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. |
This comment has been minimized.
This comment has been minimized.
3186b79
to
fb50b61
Compare
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`.
fb50b61
to
29f5c98
Compare
@bors r+ rollup=never |
📌 Commit 29f5c98 has been approved by |
☀️ Test successful - checks-actions |
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 |
All callers already check that the buffer is full before calling
grow()
. This is where it makes the most sense, sincegrow()
isinline(never)
and we don't want to pay for a function call just forthat check.
It could also be argued that it would be correct to call
grow()
evenif the buffer wasn't full yet.
This change breaks no code since
grow()
is notpub
.