We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a0d03e2 + 09296e4 commit d420610Copy full SHA for d420610
src/randstrobes.hpp
@@ -34,8 +34,8 @@ struct RefRandstrobe {
34
// RefRandstrobes in the index is reproducible no matter which sorting
35
// function is used. This branchless comparison is faster than the
36
// equivalent one using std::tie.
37
- __uint128_t lhs = (static_cast<__uint128_t>(hash) << 64) | position;
38
- __uint128_t rhs = (static_cast<__uint128_t>(other.hash) << 64) | other.position;
+ __uint128_t lhs = (static_cast<__uint128_t>(hash) << 64) | ((static_cast<uint64_t>(position) << 32) | m_packed);
+ __uint128_t rhs = (static_cast<__uint128_t>(other.hash) << 64) | ((static_cast<uint64_t>(other.position) << 32) | m_packed);
39
return lhs < rhs;
40
}
41
0 commit comments