Skip to content

Commit 7fad370

Browse files
committed
ASCII uppercase: add "subtract multiplied bool" benchmark
1 parent c1ec29a commit 7fad370

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
@@ -224,6 +224,18 @@ benches! {
224224
}
225225
}
226226

227+
fn case14_subtract_multiplied_bool_match_range(bytes: &mut [u8]) {
228+
fn is_ascii_lowercase(b: u8) -> bool {
229+
match b {
230+
b'a'...b'z' => true,
231+
_ => false
232+
}
233+
}
234+
for byte in bytes {
235+
*byte -= (b'a' - b'A') * is_ascii_lowercase(*byte) as u8
236+
}
237+
}
238+
227239
@iter
228240

229241
is_ascii,

0 commit comments

Comments
 (0)