mirror of
https://github.com/azalea-rs/simdnbt.git
synced 2025-08-02 15:36:03 +00:00
fix is_plain_ascii
This commit is contained in:
parent
ab5682f502
commit
a47a55624e
1 changed files with 6 additions and 5 deletions
11
src/mutf8.rs
11
src/mutf8.rs
|
@ -35,7 +35,8 @@ fn is_plain_ascii(slice: &[u8]) -> bool {
|
|||
}
|
||||
}
|
||||
if remainder.len() > 8 {
|
||||
let (chunk, remainder) = remainder.split_array_ref::<8>();
|
||||
let chunk;
|
||||
(chunk, remainder) = remainder.split_array_ref::<8>();
|
||||
let mask = u8x8::splat(0b10000000);
|
||||
let zero = u8x8::splat(0);
|
||||
let simd = u8x8::from_array(*chunk);
|
||||
|
@ -43,10 +44,10 @@ fn is_plain_ascii(slice: &[u8]) -> bool {
|
|||
if xor != zero {
|
||||
is_plain_ascii = false;
|
||||
}
|
||||
for &byte in remainder {
|
||||
if byte & 0b10000000 != 0 {
|
||||
is_plain_ascii = false;
|
||||
}
|
||||
}
|
||||
for &byte in remainder {
|
||||
if byte & 0b10000000 != 0 {
|
||||
is_plain_ascii = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue