Skip to content

Commit 5e1428e

Browse files
committed
manually inline function
1 parent 66195d8 commit 5e1428e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/str/validations.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ pub(super) fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
163163
// %xF4 %x80-8F 2( UTF8-tail )
164164
match w {
165165
2 => {
166-
if !utf8_is_cont_byte(next!()) {
166+
if next!() as i8 >= -64 {
167167
err!(Some(1))
168168
}
169169
}
@@ -175,7 +175,7 @@ pub(super) fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
175175
| (0xEE..=0xEF, 0x80..=0xBF) => {}
176176
_ => err!(Some(1)),
177177
}
178-
if !utf8_is_cont_byte(next!()) {
178+
if next!() as i8 >= -64 {
179179
err!(Some(2))
180180
}
181181
}
@@ -184,10 +184,10 @@ pub(super) fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
184184
(0xF0, 0x90..=0xBF) | (0xF1..=0xF3, 0x80..=0xBF) | (0xF4, 0x80..=0x8F) => {}
185185
_ => err!(Some(1)),
186186
}
187-
if !utf8_is_cont_byte(next!()) {
187+
if next!() as i8 >= -64 {
188188
err!(Some(2))
189189
}
190-
if !utf8_is_cont_byte(next!()) {
190+
if next!() as i8 >= -64 {
191191
err!(Some(3))
192192
}
193193
}

0 commit comments

Comments
 (0)