Dandandan commented on a change in pull request #644:
URL: https://github.com/apache/arrow-rs/pull/644#discussion_r680365386
##########
File path: arrow/src/array/array_primitive.rs
##########
@@ -101,12 +101,10 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {
/// Returns the primitive value at index `i`.
///
- /// 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()
+ /// Panics of offset `i` is out of bounds
#[inline]
pub fn value(&self, i: usize) -> T::Native {
- debug_assert!(i < self.len());
Review comment:
UB 2
--
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]