Skip to content

Commit 207c80f

Browse files
committed
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`
2 parents 1c02878 + 6a83352 commit 207c80f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

library/alloc/src/raw_vec.rs

+8
Original file line numberDiff line numberDiff line change

library/alloc/src/vec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change

0 commit comments

Comments
 (0)