Remove duplicate bound check in function shift
#1408
Labels
enhancement
Any new improvement worthy of a entry in the changelog
shift
#1408
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
https://github.com/apache/arrow-rs/blob/master/arrow%2Fsrc%2Fcompute%2Fkernels%2Fwindow.rs#L61-L66
When calculate
slice_offset
, we don't need to compare-offset
withvalue_len
, because we have checkedabs(offset) >= value_len
before.Describe the solution you'd like
slice_offset
should be0
whenoffset > 0
(shift left) and-offset
whenoffset < 0
(shift right). Maybe we can useclamp_min
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: