We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d4d8c8 commit 07898edCopy full SHA for 07898ed
1 file changed
native/core/src/common/bit.rs
@@ -657,7 +657,7 @@ impl BitReader {
657
debug_assert!(self.bit_offset == 0 || i == num_bits_to_read);
658
659
// Check if there's opportunity to directly copy bytes using `memcpy`.
660
- if (offset + i) % 8 == 0 && i < num_bits_to_read {
+ if (offset + i).is_multiple_of(8) && i < num_bits_to_read {
661
let num_bytes = (num_bits_to_read - i) / 8;
662
let dst_byte_offset = (offset + i) / 8;
663
if num_bytes > 0 {
@@ -671,7 +671,7 @@ impl BitReader {
671
}
672
673
674
- debug_assert!((offset + i) % 8 != 0 || num_bits_to_read - i < 8);
+ debug_assert!(!(offset + i).is_multiple_of(8) || num_bits_to_read - i < 8);
675
676
// Now copy the remaining bits if there's any.
677
while i < num_bits_to_read {
0 commit comments