File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed
vortex-vector/src/binaryview Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -208,26 +208,7 @@ impl<T: BinaryViewType> BinaryViewVector<T> {
208208 return None ;
209209 }
210210
211- let view = & self . views [ index] ;
212- if view. is_inlined ( ) {
213- let view = view. as_inlined ( ) ;
214- // SAFETY: validation that the string data contained in this vector is performed
215- // at construction time, either in the constructor for safe construction, or by
216- // the caller (when using the unchecked constructor).
217- Some ( unsafe { T :: from_bytes_unchecked ( & view. data [ ..view. size as usize ] ) } )
218- } else {
219- // Get a pointer into the buffer range
220- let view_ref = view. as_view ( ) ;
221- let buffer = & self . buffers [ view_ref. buffer_index as usize ] ;
222-
223- let start = view_ref. offset as usize ;
224- let length = view_ref. size as usize ;
225-
226- // SAFETY: validation that the string data contained in this vector is performed
227- // at construction time, either in the constructor for safe construction, or by
228- // the caller (when using the unchecked constructor).
229- Some ( unsafe { T :: from_bytes_unchecked ( & buffer. as_bytes ( ) [ start..start + length] ) } )
230- }
211+ Some ( unsafe { T :: from_bytes_unchecked ( self . get_ref_unchecked ( index) ) } )
231212 }
232213
233214 /// Get the `index` item from the vector as a [u8]
You can’t perform that action at this time.
0 commit comments