@@ -160,7 +160,7 @@ impl VTable for ALP {
160160 } )
161161 . transpose ( ) ?;
162162
163- let slots = ALPData :: make_slots ( & encoded, & patches) ;
163+ let slots = ALPData :: make_slots ( & encoded, patches. as_ref ( ) ) ;
164164 let data = ALPData :: new (
165165 Exponents {
166166 e : u8:: try_from ( metadata. exp_e ) ?,
@@ -371,7 +371,7 @@ impl ALP {
371371 pub fn new ( encoded : ArrayRef , exponents : Exponents , patches : Option < Patches > ) -> ALPArray {
372372 let dtype = ALPData :: logical_dtype ( & encoded) . vortex_expect ( "ALP encoded dtype" ) ;
373373 let len = encoded. len ( ) ;
374- let slots = ALPData :: make_slots ( & encoded, & patches) ;
374+ let slots = ALPData :: make_slots ( & encoded, patches. as_ref ( ) ) ;
375375 unsafe {
376376 Array :: from_parts_unchecked (
377377 ArrayParts :: new ( ALP , dtype, len, ALPData :: new ( exponents, patches) )
@@ -387,7 +387,7 @@ impl ALP {
387387 ) -> VortexResult < ALPArray > {
388388 let dtype = ALPData :: logical_dtype ( & encoded) ?;
389389 let len = encoded. len ( ) ;
390- let slots = ALPData :: make_slots ( & encoded, & patches) ;
390+ let slots = ALPData :: make_slots ( & encoded, patches. as_ref ( ) ) ;
391391 let data = ALPData :: new ( exponents, patches) ;
392392 Array :: try_from_parts ( ArrayParts :: new ( ALP , dtype, len, data) . with_slots ( slots) )
393393 }
@@ -401,7 +401,7 @@ impl ALP {
401401 ) -> ALPArray {
402402 let dtype = ALPData :: logical_dtype ( & encoded) . vortex_expect ( "ALP encoded dtype" ) ;
403403 let len = encoded. len ( ) ;
404- let slots = ALPData :: make_slots ( & encoded, & patches) ;
404+ let slots = ALPData :: make_slots ( & encoded, patches. as_ref ( ) ) ;
405405 let data = unsafe { ALPData :: new_unchecked ( exponents, patches) } ;
406406 unsafe {
407407 Array :: from_parts_unchecked ( ArrayParts :: new ( ALP , dtype, len, data) . with_slots ( slots) )
@@ -410,7 +410,7 @@ impl ALP {
410410}
411411
412412impl ALPData {
413- fn make_slots ( encoded : & ArrayRef , patches : & Option < Patches > ) -> Vec < Option < ArrayRef > > {
413+ fn make_slots ( encoded : & ArrayRef , patches : Option < & Patches > ) -> Vec < Option < ArrayRef > > {
414414 let ( patch_indices, patch_values, patch_chunk_offsets) = match patches {
415415 Some ( p) => (
416416 Some ( p. indices ( ) . clone ( ) ) ,
0 commit comments