aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-01-10 10:53:39 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-01-10 10:53:45 +0100
commit3d0850cec103950731bfc0f935ad997a4149d4b3 (patch)
tree65eb7ff0124e24ad7c09e63789c32abbeca95cb1 /src/test
parent542e405a8517e50bf6687a02af69117931234fde (diff)
parentefab28b06bfaa50c41337e84136cb58437e7ba00 (diff)
downloadbitcoin-3d0850cec103950731bfc0f935ad997a4149d4b3.tar.xz
Merge bitcoin/bitcoin#23994: Consolidate all uses of the fast range mapping technique in util/fastrange.h
efab28b06bfaa50c41337e84136cb58437e7ba00 Add FastRange32 function and use it throughout the codebase (Pieter Wuille) 96ecd6fa3e0f53c3a25eb7c328220b819f8dde03 scripted-diff: rename MapIntoRange to FastRange64 (Pieter Wuille) c6d15c45d971fb25551b7a66a2615e3f0bee999b [moveonly] Move MapIntoRange() to separate util/fastrange.h (Pieter Wuille) Pull request description: Several places in the codebase use the fast range mapping technique described in https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/, some for 32-bit ranges, some for 64-bit ones. Move all of these to `util/fastrange.h`, and give them a consistent name. ACKs for top commit: Sjors: ACK efab28b06bfaa50c41337e84136cb58437e7ba00 shaavan: reACK efab28b06bfaa50c41337e84136cb58437e7ba00 MarcoFalke: review ACK efab28b06bfaa50c41337e84136cb58437e7ba00 🍸 Tree-SHA512: 3190a25ef21d17f0ab2afcd9b8d5a1813fdfac0d93996878017e84ff62eee412c823d6149ae8e92cfc3214458641e83ace4b022b4a0fe0679f78dbaee21c6227
Diffstat (limited to 'src/test')
-rw-r--r--src/test/fuzz/golomb_rice.cpp2
1 files changed, 1 insertions, 1 deletions
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)