mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Auto merge of #43093 - rthomas:39791-hashmap, r=alexcrichton
Add annotations to the resize fn #39791 This adds the `inline(never)` and `cold` annotations to the HashMap::resize function.
This commit is contained in:
commit
703341051d
@ -754,6 +754,8 @@ impl<K, V, S> HashMap<K, V, S>
|
||||
/// 1) Ensure `new_raw_cap` is enough for all the elements, accounting
|
||||
/// for the load factor.
|
||||
/// 2) Ensure `new_raw_cap` is a power of two or zero.
|
||||
#[inline(never)]
|
||||
#[cold]
|
||||
fn resize(&mut self, new_raw_cap: usize) {
|
||||
assert!(self.table.size() <= new_raw_cap);
|
||||
assert!(new_raw_cap.is_power_of_two() || new_raw_cap == 0);
|
||||
|
Loading…
Reference in New Issue
Block a user