return early rather than just evaluating a rejection

The intent of these lines was "if there's no filter, return
immediately rather than doing operations".

But actually we didn't write that, so we were calling intersectionCallback
on empty filters, which didn't matter since it failed out quickly, but
it's still a waste of effort.

Except we shouldn't get to these anyway because ConsiderKey already
correctly rejected these cases. I think. But still.
This commit is contained in:
Seebs 2022-03-31 12:14:17 -05:00
parent 16fef7ffbd
commit 6e90bfc9bc

View file

@ -625,7 +625,7 @@ func (b *BitmapBitmapFilter) ConsiderData(key FilterKey, data *Container) Filter
base := uint64(key << 16)
filter := b.containers[pos]
if filter == nil {
key.RejectUntilOffset(b.nextOffsets[pos])
return key.RejectUntilOffset(b.nextOffsets[pos])
}
var lastErr error
matched := false
@ -1040,7 +1040,7 @@ func (b *BitmapBSICountFilter) ConsiderData(key FilterKey, data *Container) Filt
pos := key & keyMask
filter := b.containers[pos]
if filter == nil {
key.RejectUntilOffset(b.nextOffsets[pos])
return key.RejectUntilOffset(b.nextOffsets[pos])
}
row := uint64(key >> rowExponent) // row count within the fragment
// How do we translate the filter and existence bit into actionable things?