Skip to content

Commit

Permalink
Push count <= 8 precondition into doc comment.
Browse files Browse the repository at this point in the history
The alternative would be to actually convert the `debug_assert` to
an `assert`, or clamp to 8, but both of these could conceivably
have a performance impact, so in the interest of being a pure
win, with no downsides, that change is left to a future editor.
  • Loading branch information
ssbr committed Oct 14, 2024
1 parent c6201c7 commit c1c8bec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arrow-buffer/src/util/bit_mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ unsafe fn set_upto_64bits(
}

/// # Safety
/// The caller must ensure `data` has `offset..(offset + 8)` range
/// The caller must ensure `data` has `offset..(offset + 8)` range, and `count <= 8`.
#[inline]
unsafe fn read_bytes_to_u64(data: &[u8], offset: usize, count: usize) -> u64 {
debug_assert!(count <= 8);
Expand Down

0 comments on commit c1c8bec

Please sign in to comment.