mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
ASCII uppercase: add "subtract shifted bool" benchmark
This commit is contained in:
parent
0ad91f73d9
commit
c1ec29ace0
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user