rluvaton commented on code in PR #9277:
URL: https://github.com/apache/arrow-rs/pull/9277#discussion_r2733032074


##########
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:
   This is why I want first to merge:
   - #9278



-- 
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]

Reply via email to