Skip to content

Commit

Permalink
Add safety note
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan committed Jul 31, 2021
1 parent b6310c5 commit 37a5594
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arrow/src/array/array_boolean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ impl BooleanArray {

/// Returns the boolean value at index `i`.
///
/// Note this doesn't do any bound checking, for performance reason.
/// Panics of offset `i` is out of bounds
pub fn value(&self, i: usize) -> bool {
assert!(i < self.len());
// Safety:
// `i < self.len()
unsafe { self.value_unchecked(i) }
}
}
Expand Down

0 comments on commit 37a5594

Please sign in to comment.