File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -432,6 +432,11 @@ impl ColumnarBlock {
432432 }
433433
434434 /// Decompress all columns back to native representation
435+ ///
436+ /// Note: `resize` can be only be used with `copy_decode` if passing
437+ /// as `&mut [T]`. Passing a resized `&mut Vec<T>` will lead to an
438+ /// append operation, not an overwrite. If passing `&mut Vec<T>`, the
439+ /// `Vec` will be resized automatically by `copy_decode`.
435440 pub fn decompress_columns ( & mut self ) -> Result < ( ) > {
436441 // decompress sequence lengths
437442 {
@@ -450,7 +455,7 @@ impl ColumnarBlock {
450455
451456 // decompress npos
452457 if !self . z_npos . is_empty ( ) {
453- self . ef_bytes . resize ( self . len_nef , 0 ) ;
458+ self . ef_bytes . reserve ( self . len_nef ) ;
454459 copy_decode ( self . z_npos . as_slice ( ) , & mut self . ef_bytes ) ?;
455460
456461 let ef = EliasFano :: deserialize_from ( self . ef_bytes . as_slice ( ) ) ?;
You can’t perform that action at this time.
0 commit comments