Skip to content

Commit c1c8bec

Browse files
committed
Push count <= 8 precondition into doc comment.
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.
1 parent c6201c7 commit c1c8bec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arrow-buffer/src/util/bit_mask.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ unsafe fn set_upto_64bits(
127127
}
128128

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

0 commit comments

Comments
 (0)