Skip to content

Commit

Permalink
Always inline run_utf8_validation.
Browse files Browse the repository at this point in the history
It only has two call sites, and the one within `from_utf8` is hot within
rustc itself.
  • Loading branch information
nnethercote committed Feb 18, 2020
1 parent 5e7af46 commit ab90617
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libcore/str/mod.rs
Expand Up @@ -1499,7 +1499,7 @@ fn contains_nonascii(x: usize) -> bool {

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

0 comments on commit ab90617

Please sign in to comment.