From fda12d31fc2c2575f0b63ebbb8dbbefa1eb48726 Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Thu, 20 May 2021 09:52:11 +0200 Subject: [PATCH] inline PrimitiveArray::value --- arrow/src/array/array_primitive.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arrow/src/array/array_primitive.rs b/arrow/src/array/array_primitive.rs index d2b3b6686d9d..9101865d6631 100644 --- a/arrow/src/array/array_primitive.rs +++ b/arrow/src/array/array_primitive.rs @@ -93,6 +93,7 @@ impl PrimitiveArray { /// # Safety /// /// 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) @@ -103,6 +104,7 @@ impl PrimitiveArray { /// Note this doesn't do any bound checking, for performance reason. /// # Safety /// caller must ensure that the passed in offset is less than the array len() + #[inline] pub fn value(&self, i: usize) -> T::Native { debug_assert!(i < self.len()); unsafe { self.value_unchecked(i) }