Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix. #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions fastfilter/src/main/java/org/fastfilter/xor/XorBinaryFuse8.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,19 @@ private void addAll(long[] keys) {
// we have a possible counter overflow
// this branch is never taken except if there is a problem in the hash code
// in which case construction fails
break;
hashIndex++;
Arrays.fill(t2count, (byte) 0);
Arrays.fill(t2hash, 0);
Arrays.fill(reverseOrder, 0);

if (hashIndex > 100) {
// if construction doesn't succeed eventually,
// then there is likely a problem with the hash function
throw new IllegalArgumentException("Construction failed after " + hashIndex + " retries for size " + size);
}
// use a new random numbers
seed = Hash.randomSeed();
thomasmueller marked this conversation as resolved.
Show resolved Hide resolved
continue;
}

reverseOrderPos = 0;
Expand Down Expand Up @@ -199,11 +211,6 @@ private void addAll(long[] keys) {
Arrays.fill(t2hash, 0);
Arrays.fill(reverseOrder, 0);

// TODO
// if (hashIndex > 10) {
// System.out.println("WARNING: hashIndex " + hashIndex + "\n");
// System.out.println(size + " keys; arrayLength " + arrayLength + " reverseOrderPos " + reverseOrderPos + " segmentLength " + segmentLength + " segmentCount " + segmentCount);
// }
if (hashIndex > 100) {
// if construction doesn't succeed eventually,
// then there is likely a problem with the hash function
Expand Down