Skip to content
Permalink
Browse files

ASCII uppercase: add "subtract multiplied bool" benchmark

  • Loading branch information...
SimonSapin committed Mar 19, 2019
1 parent c1ec29a commit 7fad370fe9dc000f6f6f497a1939de6196e2c4fc
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/libcore/benches/ascii.rs
@@ -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,

0 comments on commit 7fad370

Please sign in to comment.
You can’t perform that action at this time.