mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 17:41:33 +11:00
Make fast_mod constant
This commit is contained in:
parent
dd5aad0de5
commit
bfdca7117d
|
@ -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");
|
debug_assert!(len.is_power_of_two(), "Length must be a power of 2");
|
||||||
(hash as usize) & (len - 1)
|
(hash as usize) & (len - 1)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue