viirya commented on code in PR #1825:
URL: https://github.com/apache/arrow-rs/pull/1825#discussion_r1027343300
##########
arrow/src/array/array_primitive.rs:
##########
@@ -100,17 +92,15 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {
/// caller must ensure that the passed in offset is less than the array
len()
#[inline]
pub unsafe fn value_unchecked(&self, i: usize) -> T::Native {
- let offset = i + self.offset();
- *self.raw_values.as_ptr().add(offset)
+ *self.raw_values.get_unchecked(i)
Review Comment:
This `value_unchecked` seems more costly than before? Previously it simply
takes value from the ptr (with an offset).
But `get_unchecked` on `ScalarBuffer` will create a slice first?
--
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]