Skip to content

Commit 01e95cb

Browse files
committed
Inline PiecewiseSequential range end check
Signed-off-by: Daniel King <dan@spiraldb.com>
1 parent 651151d commit 01e95cb

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

  • vortex-array/src/arrays/piecewise_sequential

vortex-array/src/arrays/piecewise_sequential/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ fn check_index_array(name: &str, array: &ArrayRef) -> VortexResult<()> {
6666
Ok(())
6767
}
6868

69-
#[inline]
70-
pub(crate) fn checked_range_end(start: usize, length: usize) -> VortexResult<usize> {
71-
start
72-
.checked_add(length)
73-
.ok_or_else(|| vortex_err!("PiecewiseSequentialArray range overflows usize"))
74-
}
75-
7669
pub(crate) fn materialize_ranges<S, L>(
7770
starts: &PrimitiveArray,
7871
lengths: &PrimitiveArray,
@@ -90,7 +83,9 @@ where
9083
for (&start, &length) in starts.iter().zip_eq(lengths) {
9184
let start: usize = start.as_();
9285
let length: usize = length.as_();
93-
let end = checked_range_end(start, length)?;
86+
let end = start
87+
.checked_add(length)
88+
.ok_or_else(|| vortex_err!("PiecewiseSequentialArray range overflows usize"))?;
9489
computed_len = computed_len
9590
.checked_add(length)
9691
.ok_or_else(|| vortex_err!("PiecewiseSequentialArray output length overflows usize"))?;

0 commit comments

Comments
 (0)