Skip to content

Commit cd391a0

Browse files
committed
simpler
Signed-off-by: Robert Kruszewski <github@robertk.io>
1 parent 339a05f commit cd391a0

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
@@ -386,16 +386,16 @@ mod tests {
386386
let clobbered_indices =
387387
PrimitiveArray::new(Buffer::from(indices_data), indices_prim.validity()).into_array();
388388

389-
Ok(unsafe {
390-
RLEArra::new_unchecked(
389+
unsafe {
390+
RLEArray::try_from_data(RLEData::new_unchecked(
391391
rle.values().clone(),
392392
clobbered_indices,
393393
rle.values_idx_offsets().clone(),
394394
rle.dtype().clone(),
395395
rle.offset(),
396396
rle.len(),
397-
)
398-
})
397+
))
398+
}
399399
}
400400

401401
#[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;
@@ -24,10 +25,6 @@ use crate::rle::RLEArrayExt;
2425
reason = "complexity is from nested match_each_* macros"
2526
)]
2627
pub fn rle_decompress(array: &RLEArray, ctx: &mut ExecutionCtx) -> VortexResult<PrimitiveArray> {
27-
if array.all_invalid()? {
28-
return Ok(Canonical::empty(array.dtype()).into_primitive());
29-
}
30-
3128
match_each_native_ptype!(array.values().dtype().as_ptype(), |V| {
3229
match_each_unsigned_integer_ptype!(array.values_idx_offsets().dtype().as_ptype(), |O| {
3330
// RLE indices are always u16 (or u8 if downcasted).

0 commit comments

Comments
 (0)