Skip to content
Permalink
Browse files

ASCII uppercase: add "subtract shifted bool" benchmark

  • Loading branch information...
SimonSapin committed Mar 19, 2019
1 parent 0ad91f7 commit c1ec29ace000ce4c733cde6948c87f9bc2370691
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/libcore/benches/ascii.rs
@@ -212,6 +212,18 @@ benches! {
}
}

fn case13_subtract_shifted_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 -= (is_ascii_lowercase(*byte) as u8) << 5
}
}

@iter

is_ascii,

0 comments on commit c1ec29a

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