diff options
-rw-r--r-- | src/blockfilter.cpp | 2 | ||||
-rw-r--r-- | src/test/fuzz/golomb_rice.cpp | 2 | ||||
-rw-r--r-- | src/util/fastrange.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/blockfilter.cpp b/src/blockfilter.cpp index 566254d839..63a9ba498f 100644 --- a/src/blockfilter.cpp +++ b/src/blockfilter.cpp @@ -29,7 +29,7 @@ uint64_t GCSFilter::HashToRange(const Element& element) const uint64_t hash = CSipHasher(m_params.m_siphash_k0, m_params.m_siphash_k1) .Write(element.data(), element.size()) .Finalize(); - return MapIntoRange(hash, m_F); + return FastRange64(hash, m_F); } std::vector<uint64_t> GCSFilter::BuildHashedSet(const ElementSet& elements) const diff --git a/src/test/fuzz/golomb_rice.cpp b/src/test/fuzz/golomb_rice.cpp index 2d0b29953c..b4bb4c6dc6 100644 --- a/src/test/fuzz/golomb_rice.cpp +++ b/src/test/fuzz/golomb_rice.cpp @@ -25,7 +25,7 @@ uint64_t HashToRange(const std::vector<uint8_t>& element, const uint64_t f) const uint64_t hash = CSipHasher(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL) .Write(element.data(), element.size()) .Finalize(); - return MapIntoRange(hash, f); + return FastRange64(hash, f); } std::vector<uint64_t> BuildHashedSet(const std::unordered_set<std::vector<uint8_t>, ByteVectorHash>& elements, const uint64_t f) diff --git a/src/util/fastrange.h b/src/util/fastrange.h index 57bb8e07dc..963d21c03a 100644 --- a/src/util/fastrange.h +++ b/src/util/fastrange.h @@ -12,7 +12,7 @@ // x * n. // // See: https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/ -static inline uint64_t MapIntoRange(uint64_t x, uint64_t n) +static inline uint64_t FastRange64(uint64_t x, uint64_t n) { #ifdef __SIZEOF_INT128__ return (static_cast<unsigned __int128>(x) * static_cast<unsigned __int128>(n)) >> 64; |