Skip to content

Commit

Permalink
ASCII uppercase: add "subtract multiplied bool" benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Mar 19, 2019
1 parent c1ec29a commit 7fad370
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libcore/benches/ascii.rs
Expand Up @@ -224,6 +224,18 @@ benches! {
}
}

fn case14_subtract_multiplied_bool_match_range(bytes: &mut [u8]) {
fn is_ascii_lowercase(b: u8) -> bool {
match b {
b'a'...b'z' => true,
_ => false
}
}
for byte in bytes {
*byte -= (b'a' - b'A') * is_ascii_lowercase(*byte) as u8
}
}

@iter

is_ascii,
Expand Down

0 comments on commit 7fad370

Please sign in to comment.