From bfdca7117d81ce06f84cf0c34b3f178ce20db0d7 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 17 Mar 2022 23:46:45 +0000 Subject: [PATCH] Make fast_mod constant --- agb/src/hash_map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agb/src/hash_map.rs b/agb/src/hash_map.rs index f055a0ed..3ea08233 100644 --- a/agb/src/hash_map.rs +++ b/agb/src/hash_map.rs @@ -59,7 +59,7 @@ impl HashMap { } } -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) }