Open
Description
File: util/bloom.cc
Line: 50: array[bitpos / 8] |= (1 << (bitpos % 8));
This line sets the bit at position n by shifting 1 left by the remainder of n divided by 8. However, it does not set the nth bit directly; instead, it sets the bit at position (n / 8) * 8 + (8 - n % 8).
According to standard Bloom filter logic, we should set the nth bit (where n is calculated by hashing the key). While the current implementation functions correctly, aligning with traditional Bloom filter logic could enhance clarity. However, if this is changed to align with the original implementation of Bloom filters, existing databases may encounter issues such as data loss or incorrect results.
Metadata
Metadata
Assignees
Labels
No labels