Skip to content

Commit c1ec29a

Browse files
committed
ASCII uppercase: add "subtract shifted bool" benchmark
1 parent 0ad91f7 commit c1ec29a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libcore/benches/ascii.rs

+12
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,18 @@ benches! {
212212
}
213213
}
214214

215+
fn case13_subtract_shifted_bool_match_range(bytes: &mut [u8]) {
216+
fn is_ascii_lowercase(b: u8) -> bool {
217+
match b {
218+
b'a'...b'z' => true,
219+
_ => false
220+
}
221+
}
222+
for byte in bytes {
223+
*byte -= (is_ascii_lowercase(*byte) as u8) << 5
224+
}
225+
}
226+
215227
@iter
216228

217229
is_ascii,

0 commit comments

Comments
 (0)