Skip to content

Commit 070fd02

Browse files
committed
Add an unlikely hint to reserve
1 parent c4e869c commit 070fd02

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/raw/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ impl<T, A: Allocator + Clone> RawTable<T, A> {
657657
/// without reallocation.
658658
#[cfg_attr(feature = "inline-more", inline)]
659659
pub fn reserve(&mut self, additional: usize, hasher: impl Fn(&T) -> u64) {
660-
if additional > self.table.growth_left {
660+
if unlikely(additional > self.table.growth_left) {
661661
// Avoid `Result::unwrap_or_else` because it bloats LLVM IR.
662662
if self
663663
.reserve_rehash(additional, hasher, Fallibility::Infallible)

0 commit comments

Comments
 (0)