We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5496579 commit a95d6dfCopy full SHA for a95d6df
src/read.rs
@@ -453,9 +453,14 @@ impl<'a> SliceRead<'a> {
453
let contains_backslash = chars_backslash.wrapping_sub(ONE_BYTES) & !chars_backslash;
454
let masked = (contains_ctrl | contains_quote | contains_backslash) & (ONE_BYTES << 7);
455
if masked != 0 {
456
+ let addresswise_first_bit = if cfg!(target_endian = "little") {
457
+ masked.trailing_zeros()
458
+ } else {
459
+ masked.leading_zeros()
460
+ };
461
// SAFETY: chunk is in-bounds for slice
462
self.index = unsafe { chunk.as_ptr().offset_from(self.slice.as_ptr()) } as usize
- + masked.trailing_zeros() as usize / 8;
463
+ + addresswise_first_bit as usize / 8;
464
return;
465
}
466
0 commit comments