pitrou commented on code in PR #13857:
URL: https://github.com/apache/arrow/pull/13857#discussion_r979191458


##########
cpp/src/arrow/compute/kernels/vector_selection.cc:
##########
@@ -329,10 +480,9 @@ struct PrimitiveTakeImpl {
         if (block.popcount == block.length) {
           // Faster path: indices are not null but values may be
           for (int64_t i = 0; i < block.length; ++i) {
-            if (bit_util::GetBit(values_is_valid,
-                                 values_offset + indices_data[position])) {
+            if (values.IsValid(indices_data[position])) {
               // value is not null
-              out[position] = values_data[indices_data[position]];
+              out[position] = values.GetValue(indices_data[position]);

Review Comment:
   I'll note that in the `IsValid` -> `GetValue` sequence the chunked 
resolution is called twice. The compiler might be able to optimize away the 
second call but that's not guaranteed.



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