mzabaluev commented on PR #11872:
URL: https://github.com/apache/arrow-rs/pull/11872#issuecomment-6468829208
@mightsleep Is wrapping arithmetic meaningful here, besides making a
"negative"-or-zero offset within `usize`? I have rewritten it to ordinary
operations in the native offset type, so that the code is more readable, and it
didn't destroy vectorization, so I believe it should work the same way.
> ```rust
> let mut extend = |start: usize, end: usize| {
> let value_start = offsets[start].as_usize();
> let value_end = offsets[end].as_usize();
> let shift = cur_offset.wrapping_sub(value_start);
> dst_offsets.extend(
> offsets[start + 1..=end]
> .iter()
> .map(|o| O::usize_as(o.as_usize().wrapping_add(shift))),
> );
> cur_offset += value_end - value_start;
> // child_slices as before
> };
> ```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]