File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
fastfilter/src/main/java/org/fastfilter/xorplus Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,15 @@ public long getBitCount() {
6767 }
6868
6969 /**
70- * Calculate the table (array) length. This is 1.23 times the size, plus an offset of 32 (see paper, Fig. 1)
70+ * Calculate the table (array) length. This is 1.23 times the size, plus an offset of 32 (see paper, Fig. 1).
71+ * We round down to a multiple of HASHES, as any excess entries couldn't be used.
7172 *
7273 * @param size the number of entries
7374 * @return the table length
7475 */
7576 private static int getArrayLength (int size ) {
76- return (int ) (OFFSET + (long ) FACTOR_TIMES_100 * size / 100 );
77+ int arrayLength = (int ) (OFFSET + (long ) FACTOR_TIMES_100 * size / 100 );
78+ return arrayLength - (arrayLength % HASHES );
7779 }
7880
7981 public static XorPlus8 construct (long [] keys ) {
You can’t perform that action at this time.
0 commit comments