Skip to content

Commit c7fc6db

Browse files
committed
Add annotations to the resize fn #39791
This adds the `inline(never)` and `cold` annotations to the HashMap::resize function.
1 parent 54fc9e4 commit c7fc6db

File tree

1 file changed

+2
-0
lines changed
  • src/libstd/collections/hash

1 file changed

+2
-0
lines changed

src/libstd/collections/hash/map.rs

+2
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,8 @@ impl<K, V, S> HashMap<K, V, S>
754754
/// 1) Ensure `new_raw_cap` is enough for all the elements, accounting
755755
/// for the load factor.
756756
/// 2) Ensure `new_raw_cap` is a power of two or zero.
757+
#[inline(never)]
758+
#[cold]
757759
fn resize(&mut self, new_raw_cap: usize) {
758760
assert!(self.table.size() <= new_raw_cap);
759761
assert!(new_raw_cap.is_power_of_two() || new_raw_cap == 0);

0 commit comments

Comments
 (0)