Skip to content

Commit 8172fcb

Browse files
committed
Revert filter change
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent 015b5d7 commit 8172fcb

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

vortex-compute/src/filter/slice.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use vortex_buffer::BitView;
1616
use vortex_buffer::Buffer;
1717
use vortex_buffer::BufferMut;
1818
use vortex_mask::Mask;
19+
use vortex_mask::MaskIter;
1920
use vortex_mask::MaskValues;
2021

2122
use crate::filter::Filter;
@@ -45,16 +46,9 @@ impl<T: Copy> Filter<MaskValues> for &[T] {
4546
"Selection mask length must equal the buffer length"
4647
);
4748

48-
if mask_values.density() >= FILTER_SLICES_SELECTIVITY_THRESHOLD {
49-
// High density: use slices (contiguous ranges)
50-
self.filter(mask_values.slices())
51-
} else {
52-
// Low density: stream indices directly from bitmap without allocating
53-
let mut out = BufferMut::<T>::with_capacity(mask_values.true_count());
54-
for idx in mask_values.bit_buffer().set_indices() {
55-
out.push(self[idx]);
56-
}
57-
out.freeze()
49+
match mask_values.threshold_iter(FILTER_SLICES_SELECTIVITY_THRESHOLD) {
50+
MaskIter::Indices(indices) => self.filter(indices),
51+
MaskIter::Slices(slices) => self.filter(slices),
5852
}
5953
}
6054
}

0 commit comments

Comments
 (0)