Skip to content

Commit 785e850

Browse files
committed
Bloom filter: ensure branchless is only used for k >= 3
1 parent 2794c29 commit 785e850

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bloom.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Status BloomFilter<ItemType, bits_per_item, branchless, HashFamily, k>::Contain(
147147
uint64_t hash = hasher(key);
148148
uint32_t a = (uint32_t)(hash >> 32);
149149
uint32_t b = (uint32_t)hash;
150-
if (branchless) {
150+
if (branchless && k >= 3) {
151151
int b0 = data[reduce(a, this->arrayLength)] >> (a & 63);
152152
a += b;
153153
int b1 = data[reduce(a, this->arrayLength)] >> (a & 63);

0 commit comments

Comments
 (0)