This commit is contained in:
Looly
2020-03-05 23:09:43 +08:00
parent 95561c1410
commit 3746c6048f
5 changed files with 83 additions and 10 deletions

View File

@@ -66,8 +66,8 @@ public class BitSetBloomFilter implements BloomFilter{
}
int[] positions = createHashes(str, hashFunctionNumber);
for (int i = 0; i < positions.length; i++) {
int position = Math.abs(positions[i] % bitSetSize);
for (int value : positions) {
int position = Math.abs(value % bitSetSize);
bitSet.set(position, true);
}
return true;