Skip to content

Commit fedb8f1

Browse files
committed
Making it more robust.
1 parent 3b820e0 commit fedb8f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/simd-block-fixed-fpp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ template <typename HashFamily>
266266
SimdBlockFilterFixed64<HashFamily>::Add(const uint64_t key) noexcept {
267267
const auto hash = hasher_(key);
268268
const uint32_t bucket_idx = reduce(rotl64(hash, 32), bucketCount);
269-
mask64bytes_t mask = MakeMask(key);
269+
mask64bytes_t mask = MakeMask(hash);
270270
mask64bytes_t* const bucket = &reinterpret_cast<mask64bytes_t*>(directory_)[bucket_idx];
271271
bucket->first = _mm256_or_si256(mask.first, bucket->first);
272272
bucket->second= _mm256_or_si256(mask.second, bucket->second);
@@ -278,7 +278,7 @@ template <typename HashFamily>
278278
SimdBlockFilterFixed64<HashFamily>::Find(const uint64_t key) const noexcept {
279279
const auto hash = hasher_(key);
280280
const uint32_t bucket_idx = reduce(rotl64(hash, 32), bucketCount);
281-
const mask64bytes_t mask = MakeMask(key);
281+
const mask64bytes_t mask = MakeMask(hash);
282282
const mask64bytes_t bucket = reinterpret_cast<mask64bytes_t*>(directory_)[bucket_idx];
283283
return _mm256_testc_si256(bucket.first, mask.first) & _mm256_testc_si256(bucket.second, mask.second);
284284
}

0 commit comments

Comments
 (0)