mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 08:30:35 +00:00
max_size, as currently used, will return -1 and while it will fix the previous bug, it will uncover another. We can go back to using size, as long as we make sure that all sites correctly pick a size when creating the bitset. Aside from that, for compatibility with the java code, the total number of bits has to be a power of two. The best way to achieve those goals, is to just set the size ourselves through resize() in the filter constructor. num_blocks() * bits_per_block is guaranteed to yield a power of two as we need, and in case one caller did not explicitly set a size, it will be set from this moment on. Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>