Dandandan commented on code in PR #9277:
URL: https://github.com/apache/arrow-rs/pull/9277#discussion_r2733011671
##########
arrow-select/src/take.rs:
##########
@@ -445,7 +445,13 @@ fn take_native<T: ArrowNativeType, I: ArrowPrimitiveType>(
None => indices
.values()
.iter()
- .map(|index| values[index.as_usize()])
+ .map(|index| {
+ let index = index.as_usize();
+ // Safety: we either checked already bounds (passed
check_bounds = true) or the user
+ // guarantees the value to be in range.
+ // Avoiding bound checks allows the compiler to
vectorize it and do better loop unrolling
Review Comment:
We can't just do this, as we get the indices from the user / other safe ckdd
(and we don't check bounds by default).
--
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]