Java-BloomFilter icon indicating copy to clipboard operation
Java-BloomFilter copied to clipboard

Request: "getAndAdd" method

Open salamanders opened this issue 13 years ago • 0 comments

For iterating through huge lists with duplicates and using the bloom filter to make sure each use of an item from the list is only done once, it might speed things up to have a combined containsAndAdd method to avoid hanging to hash the same input twice.

if (myBloom.contains(itemFromList)) {
  return;
}
myBloom.add(itemFromList);
//... do things ...

salamanders avatar Feb 10 '12 21:02 salamanders