sunchao commented on a change in pull request #1420:
URL: https://github.com/apache/arrow-rs/pull/1420#discussion_r824331630
##########
File path: arrow/src/array/array_binary.rs
##########
@@ -473,6 +473,18 @@ impl FixedSizeBinaryArray {
}
}
+ /// Returns the element at index `i` as a byte slice.
+ /// # Safety
+ /// Caller is responsible for ensuring that the index is within the bounds
of the array
+ pub unsafe fn value_unchecked(&self, i: usize) -> &[u8] {
+ let offset = i.checked_add(self.data.offset()).unwrap();
Review comment:
can we change `value` to use this in order to avoid code duplication?
##########
File path: arrow/src/array/array_binary.rs
##########
@@ -473,6 +473,18 @@ impl FixedSizeBinaryArray {
}
}
+ /// Returns the element at index `i` as a byte slice.
+ /// # Safety
Review comment:
nit: can we add blank lines before & after?
--
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]