Skip to content

Commit

Permalink
Merge pull request #398 from ksahlin/deterministic
Browse files Browse the repository at this point in the history
Make index creation deterministic
  • Loading branch information
marcelm authored Feb 28, 2024
2 parents a0d03e2 + 09296e4 commit d420610
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/randstrobes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ struct RefRandstrobe {
// RefRandstrobes in the index is reproducible no matter which sorting
// function is used. This branchless comparison is faster than the
// equivalent one using std::tie.
__uint128_t lhs = (static_cast<__uint128_t>(hash) << 64) | position;
__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);
return lhs < rhs;
}

Expand Down

0 comments on commit d420610

Please sign in to comment.