]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Auto merge of #91352 - nnethercote:RawVec-reserve_for_push, r=dtolnay
authorbors <bors@rust-lang.org>
Tue, 30 Nov 2021 13:52:38 +0000 (13:52 +0000)
committerbors <bors@rust-lang.org>
Tue, 30 Nov 2021 13:52:38 +0000 (13:52 +0000)
commit207c80f105282245d93024c95ac408c622f70114
treee05bfbe67697f3d435a8243c1c1921151ecd6bf3
parent1c0287830e0fb3c4007afea2819ba03766da6e9c
parent6a83352aa3cb80eb83cb57aba30aad32d3881af7
Auto merge of #91352 - nnethercote:RawVec-reserve_for_push, r=dtolnay

Introduce `RawVec::reserve_for_push`.

If `Vec::push`'s capacity check fails it calls `RawVec::reserve`, which
then also does a capacity check.

This commit introduces `reserve_for_push` which skips the redundant
capacity check, for some slight compile time speed-ups.

I tried lots of minor variations on this, e.g. different inlining
attributes. This was the best one I could find.

r? `@ghost`