diff options
author | Pieter Wuille <pieter@wuille.net> | 2022-01-06 11:29:08 -0500 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2022-01-06 11:29:55 -0500 |
commit | 96ecd6fa3e0f53c3a25eb7c328220b819f8dde03 (patch) | |
tree | 3506cd32d7d05afc3813915a2ec90d1bbb93318d | |
parent | c6d15c45d971fb25551b7a66a2615e3f0bee999b (diff) |
scripted-diff: rename MapIntoRange to FastRange64
-BEGIN VERIFY SCRIPT-
sed -i -e 's/MapIntoRange/FastRange64/' src/blockfilter.cpp src/test/fuzz/golomb_rice.cpp src/util/fastrange.h
-END VERIFY SCRIPT-
-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; |