Skip to content

Commit 96ecd6f

Browse files
committed
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-
1 parent c6d15c4 commit 96ecd6f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/blockfilter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ uint64_t GCSFilter::HashToRange(const Element& element) const
2929
uint64_t hash = CSipHasher(m_params.m_siphash_k0, m_params.m_siphash_k1)
3030
.Write(element.data(), element.size())
3131
.Finalize();
32-
return MapIntoRange(hash, m_F);
32+
return FastRange64(hash, m_F);
3333
}
3434

3535
std::vector<uint64_t> GCSFilter::BuildHashedSet(const ElementSet& elements) const

src/test/fuzz/golomb_rice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ uint64_t HashToRange(const std::vector<uint8_t>& element, const uint64_t f)
2525
const uint64_t hash = CSipHasher(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL)
2626
.Write(element.data(), element.size())
2727
.Finalize();
28-
return MapIntoRange(hash, f);
28+
return FastRange64(hash, f);
2929
}
3030

3131
std::vector<uint64_t> BuildHashedSet(const std::unordered_set<std::vector<uint8_t>, ByteVectorHash>& elements, const uint64_t f)

src/util/fastrange.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// x * n.
1313
//
1414
// See: https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
15-
static inline uint64_t MapIntoRange(uint64_t x, uint64_t n)
15+
static inline uint64_t FastRange64(uint64_t x, uint64_t n)
1616
{
1717
#ifdef __SIZEOF_INT128__
1818
return (static_cast<unsigned __int128>(x) * static_cast<unsigned __int128>(n)) >> 64;

0 commit comments

Comments
 (0)