Skip to content

Commit 55356c9

Browse files
committed
wip
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 0f0b58d commit 55356c9

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

vortex-vector/src/binaryview/vector.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff 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]

0 commit comments

Comments
 (0)