alamb commented on code in PR #11782:
URL: https://github.com/apache/arrow-rs/pull/11782#discussion_r4341880663


##########
arrow-select/src/coalesce/primitive.rs:
##########
@@ -164,9 +183,8 @@ impl<T: ArrowPrimitiveType + Debug> InProgressArray for 
InProgressPrimitiveArray
 
         // Copy the values
         let values = s.values();
-        // SAFETY: copy_rows is called with ranges derived from the source 
array.
         self.current
-            .extend_from_slice(unsafe { values.get_unchecked(offset..offset + 
len) });
+            .extend_from_slice(&values[offset..offset + len]);

Review Comment:
   here is another call I think will not slow things down, but I am running 
benchmarks to be sure



##########
arrow-select/src/coalesce/byte_view.rs:
##########
@@ -408,8 +417,7 @@ impl<B: ByteViewType> InProgressArray for 
InProgressByteViewArray<B> {
         }
 
         let buffers = s.data_buffers();
-        // SAFETY: copy_rows is called with ranges derived from the source 
array.
-        let views = unsafe { s.views().as_ref().get_unchecked(offset..offset + 
len) };
+        let views = &s.views().as_ref()[offset..offset + len];

Review Comment:
   I am not sure if this will make a performance difference -- as it is called 
once per copy_rows. I am running benchmarks to decide



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