diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2025-04-02 06:43:43 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2025-04-02 06:43:43 -0500 |
commit | e6d9330a978373ffc24209b5edf03eda6491f818 (patch) | |
tree | 9f24009ef6645263d9eb92bb338c69bd23d9afd5 /include/fud_hash.hpp | |
parent | 1d2ad781398d2a8743899eb54153998ca03ac090 (diff) |
Add more testing for hash maps.
Diffstat (limited to 'include/fud_hash.hpp')
-rw-r--r-- | include/fud_hash.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/fud_hash.hpp b/include/fud_hash.hpp index a472171..8567e1f 100644 --- a/include/fud_hash.hpp +++ b/include/fud_hash.hpp @@ -36,6 +36,9 @@ namespace fud::detail { constexpr uint64_t roundToNearest2(uint64_t inputValue) noexcept { + if (inputValue == 0) { + return 1; + } uint64_t outputValue = inputValue - 1; constexpr uint8_t max2PowerShift = 32; for (uint8_t shift = 1; shift <= max2PowerShift; shift *= 2) { |