diff --git a/encodings/fastlanes/src/for/compress.rs b/encodings/fastlanes/src/for/compress.rs index 03a4e19536..d8aca00adf 100644 --- a/encodings/fastlanes/src/for/compress.rs +++ b/encodings/fastlanes/src/for/compress.rs @@ -85,33 +85,34 @@ fn compress_primitive( } pub fn decompress(array: FoRArray) -> VortexResult { - let shift = array.shift(); + let shift = array.shift() as usize; let ptype = array.ptype(); let encoded = array.encoded().into_primitive()?.reinterpret_cast(ptype); + let validity = encoded.validity(); Ok(match_each_integer_ptype!(ptype, |$T| { let reference: $T = array.reference().try_into()?; PrimitiveArray::from_vec( - decompress_primitive(encoded.maybe_null_slice::<$T>(), reference, shift), - encoded.validity(), + decompress_primitive(encoded.into_maybe_null_slice::<$T>(), reference, shift), + validity, ) })) } fn decompress_primitive( - values: &[T], + values: Vec, reference: T, - shift: u8, + shift: usize, ) -> Vec { if shift > 0 { values - .iter() - .map(|&v| v << shift as usize) + .into_iter() + .map(|v| v << shift) .map(|v| v.wrapping_add(&reference)) .collect_vec() } else { values - .iter() - .map(|&v| v.wrapping_add(&reference)) + .into_iter() + .map(|v| v.wrapping_add(&reference)) .collect_vec() } }