Skip to content

Commit ab90617

Browse files
committed
Always inline run_utf8_validation.
It only has two call sites, and the one within `from_utf8` is hot within rustc itself.
1 parent 5e7af46 commit ab90617

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/str/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ fn contains_nonascii(x: usize) -> bool {
14991499

15001500
/// Walks through `v` checking that it's a valid UTF-8 sequence,
15011501
/// returning `Ok(())` in that case, or, if it is invalid, `Err(err)`.
1502-
#[inline]
1502+
#[inline(always)]
15031503
fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
15041504
let mut index = 0;
15051505
let len = v.len();

0 commit comments

Comments
 (0)