This is an automated email from the ASF dual-hosted git repository.
dheres pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 087cf17 inline PrimitiveArray::value (#329)
087cf17 is described below
commit 087cf17edcabce032a473a80fcd1d952904b4b13
Author: Ritchie Vink <[email protected]>
AuthorDate: Thu May 20 17:30:03 2021 +0200
inline PrimitiveArray::value (#329)
---
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 d2b3b66..9101865 100644
--- a/arrow/src/array/array_primitive.rs
+++ b/arrow/src/array/array_primitive.rs
@@ -93,6 +93,7 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {
/// # 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<T: ArrowPrimitiveType> PrimitiveArray<T> {
/// 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) }