alamb commented on code in PR #9910:
URL: https://github.com/apache/arrow-rs/pull/9910#discussion_r3190929795
##########
arrow-array/src/array/fixed_size_binary_array.rs:
##########
@@ -239,19 +216,14 @@ impl FixedSizeBinaryArray {
/// # Panics
/// Panics if index `i` is out of bounds.
pub fn value(&self, i: usize) -> &[u8] {
+ let len = self.len();
assert!(
- i < self.len(),
- "Trying to access an element at index {} from a
FixedSizeBinaryArray of length {}",
- i,
- self.len()
+ i < len,
+ "Trying to access an element at index {i} from a
FixedSizeBinaryArray of length {len}",
);
- let offset = i + self.offset();
+ let position = i * self.value_size;
Review Comment:
self.offset() always returns `0` so calling `self.offset()` I think
unecessairly makes the implementation more confusing
--
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]