Bloom filter changes: address review feedback

This are minor stylistic changes requested in GH-2085.
This commit is contained in:
Johanna Amann 2022-05-12 11:09:31 +01:00 committed by Johanna Amann
parent a34a597e4c
commit b61fe59f9f
2 changed files with 3 additions and 9 deletions

View file

@ -722,14 +722,6 @@ BloomFilterValPtr BloomFilterVal::Intersect(const BloomFilterVal* x, const Bloom
return nullptr; return nullptr;
} }
auto final_type = x->Type() ? x->Type() : y->Type();
if ( typeid(*x->bloom_filter) != typeid(*y->bloom_filter) )
{
reporter->Error("cannot merge different Bloom filter types");
return nullptr;
}
if ( typeid(*x->bloom_filter) != typeid(*y->bloom_filter) ) if ( typeid(*x->bloom_filter) != typeid(*y->bloom_filter) )
{ {
reporter->Error("cannot intersect different Bloom filter types"); reporter->Error("cannot intersect different Bloom filter types");
@ -744,6 +736,8 @@ BloomFilterValPtr BloomFilterVal::Intersect(const BloomFilterVal* x, const Bloom
return nullptr; return nullptr;
} }
auto final_type = x->Type() ? x->Type() : y->Type();
auto intersected = make_intrusive<BloomFilterVal>(intersected_bf); auto intersected = make_intrusive<BloomFilterVal>(intersected_bf);
if ( final_type && ! intersected->Typify(final_type) ) if ( final_type && ! intersected->Typify(final_type) )

View file

@ -160,7 +160,7 @@ function bloomfilter_add%(bf: opaque of bloomfilter, x: any%): any
## Decrements the counter for an element that was added to a counting bloom filter in the past. ## Decrements the counter for an element that was added to a counting bloom filter in the past.
## ##
## Note that decrement operations can use to false negatives if used on a counting bloom-filter ## Note that decrement operations can lead to false negatives if used on a counting bloom-filter
## that exceeded the width of its counter. ## that exceeded the width of its counter.
## ##
## bf: The coubting bloom filter handle. ## bf: The coubting bloom filter handle.