Skip to content

Commit

Permalink
reduce code complex
Browse files Browse the repository at this point in the history
  • Loading branch information
Weijun-H committed Jan 31, 2024
1 parent 45330a2 commit f69c29e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions datafusion/physical-expr/src/array_expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2817,12 +2817,10 @@ where

let mut index = end - O::one();
let mut cnt = 0;
let stride: O = (-1_i64).try_into().map_err(|_| {
internal_datafusion_err!("array_reverse: failed to convert size to i64")
})?;

while index >= start {
mutable.extend(0, index.to_usize().unwrap(), index.to_usize().unwrap() + 1);
index += stride;
index = index - O::one();
cnt += 1;
}
offsets.push(offsets[row_index] + O::usize_as(cnt));
Expand Down

0 comments on commit f69c29e

Please sign in to comment.