Make fast_mod constant

This commit is contained in:
Gwilym Kuiper 2022-03-17 23:46:45 +00:00
parent dd5aad0de5
commit bfdca7117d

View file

@ -59,7 +59,7 @@ impl<K, V> HashMap<K, V> {
}
}
fn fast_mod(len: usize, hash: HashType) -> usize {
const fn fast_mod(len: usize, hash: HashType) -> usize {
debug_assert!(len.is_power_of_two(), "Length must be a power of 2");
(hash as usize) & (len - 1)
}