We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20bd7f0 commit 4a8b04eCopy full SHA for 4a8b04e
src/libcore/str/mod.rs
@@ -1292,13 +1292,11 @@ fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
1292
if align == 0 {
1293
while offset < blocks_end {
1294
unsafe {
1295
- let u = *(ptr.offset(offset as isize) as *const usize);
1296
- let v = *(ptr.offset((offset + usize_bytes) as isize) as *const usize);
1297
-
+ let block = ptr.offset(offset as isize) as *const usize;
1298
// break if there is a nonascii byte
1299
- let zu = contains_nonascii(u);
1300
- let zv = contains_nonascii(v);
1301
- if zu || zv {
+ let zu = contains_nonascii(*block);
+ let zv = contains_nonascii(*block.offset(1));
+ if zu | zv {
1302
break;
1303
}
1304
0 commit comments