Skip to content

Commit 03793f2

Browse files
committed
simpler
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent bf59fc6 commit 03793f2

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

encodings/fastlanes/src/rle/array/rle_compress.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,16 @@ mod tests {
380380
let clobbered_indices =
381381
PrimitiveArray::new(Buffer::from(indices_data), indices_prim.validity()).into_array();
382382

383-
Ok(unsafe {
384-
RLEArra::new_unchecked(
383+
unsafe {
384+
RLEArray::try_from_data(RLEData::new_unchecked(
385385
rle.values().clone(),
386386
clobbered_indices,
387387
rle.values_idx_offsets().clone(),
388388
rle.dtype().clone(),
389389
rle.offset(),
390390
rle.len(),
391-
)
392-
})
391+
))
392+
}
393393
}
394394

395395
#[test]

encodings/fastlanes/src/rle/array/rle_decompress.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use fastlanes::RLE;
55
use num_traits::AsPrimitive;
6+
use num_traits::NumCast;
67
use vortex_array::ExecutionCtx;
78
use vortex_array::IntoArray;
89
use vortex_array::arrays::PrimitiveArray;
@@ -23,10 +24,6 @@ use crate::RLEArray;
2324
reason = "complexity is from nested match_each_* macros"
2425
)]
2526
pub fn rle_decompress(array: &RLEArray, ctx: &mut ExecutionCtx) -> VortexResult<PrimitiveArray> {
26-
if array.all_invalid()? {
27-
return Ok(Canonical::empty(array.dtype()).into_primitive());
28-
}
29-
3027
match_each_native_ptype!(array.values().dtype().as_ptype(), |V| {
3128
match_each_unsigned_integer_ptype!(array.values_idx_offsets().dtype().as_ptype(), |O| {
3229
// RLE indices are always u16 (or u8 if downcasted).

0 commit comments

Comments
 (0)