use crate::bloom_sol::struct_def::CountingBloomFilter;
use std::hash::Hash;
impl CountingBloomFilter {
/// Removes an item from the filter if it exists.
///
/// Note: Due to the probabilistic nature, removing non-inserted items may affect accuracy.
pub fn remove<T: Hash>(&mut self, item: &T) {
for index in self.get_hash_indices(item) {
if self.counters[index] > 0 {
self.counters[index] -= 1;
}
}
}
}