Skip to content

Commit f0b7a23

Browse files
committed
rebase
Signed-off-by: Robert Kruszewski <[email protected]>
1 parent 0bfd941 commit f0b7a23

File tree

1 file changed

+17
-25
lines changed

1 file changed

+17
-25
lines changed

vortex-array/src/arrays/dict/array.rs

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@
44
use std::fmt::Debug;
55
use std::hash::Hash;
66

7-
<<<<<<< HEAD:vortex-array/src/arrays/dict/array.rs
87
use vortex_buffer::BitBuffer;
9-
=======
10-
use vortex_array::stats::{ArrayStats, StatsSetRef};
11-
use vortex_array::vtable::{ArrayVTable, NotSupported, VTable, ValidityVTable};
12-
use vortex_array::{
13-
Array, ArrayEq, ArrayHash, ArrayRef, EncodingId, EncodingRef, Precision, ToCanonical, vtable,
14-
};
15-
use vortex_buffer::{BitBuffer, BitBufferMut};
16-
>>>>>>> 541544af8 (perf[dict]: unreferenced mask Vec<bool>):encodings/dict/src/array.rs
178
use vortex_dtype::{DType, match_each_integer_ptype};
189
use vortex_error::{VortexExpect as _, VortexResult, vortex_bail};
1910
use vortex_mask::{AllOr, Mask};
@@ -128,23 +119,24 @@ impl DictArray {
128119
let values_len = self.values().len();
129120

130121
let mut unreferenced_vec = vec![true; values_len];
131-
if codes_validity.all_true() {
132-
match_each_integer_ptype!(codes_primitive.ptype(), |P| {
133-
#[allow(clippy::cast_possible_truncation)]
134-
for &code in codes_primitive.as_slice::<P>().iter() {
135-
unreferenced_vec[code as usize] = false;
136-
}
137-
});
138-
} else {
139-
match_each_integer_ptype!(codes_primitive.ptype(), |P| {
140-
let codes = codes_primitive.as_slice::<P>();
141-
codes_validity
142-
.to_bit_buffer()
143-
.set_indices()
144-
.for_each(|idx| {
122+
match codes_validity.bit_buffer() {
123+
AllOr::All => {
124+
match_each_integer_ptype!(codes_primitive.ptype(), |P| {
125+
#[allow(clippy::cast_possible_truncation)]
126+
for &code in codes_primitive.as_slice::<P>().iter() {
127+
unreferenced_vec[code as usize] = false;
128+
}
129+
});
130+
}
131+
AllOr::None => {}
132+
AllOr::Some(buf) => {
133+
match_each_integer_ptype!(codes_primitive.ptype(), |P| {
134+
let codes = codes_primitive.as_slice::<P>();
135+
buf.set_indices().for_each(|idx| {
145136
unreferenced_vec[codes[idx] as usize] = false;
146-
});
147-
})
137+
})
138+
});
139+
}
148140
}
149141

150142
Ok(BitBuffer::collect_bool(values_len, |idx| {

0 commit comments

Comments
 (0)