mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
707d8c3f1b
Refactor some `char`, `u8` ASCII functions to be branchless Extract conditions in singular `matches!` with or-patterns to individual `matches!` statements which enables branchless code output. The following functions were changed: - `is_ascii_alphanumeric` - `is_ascii_hexdigit` - `is_ascii_punctuation` Added codegen tests --- Continued from https://github.com/rust-lang/rust/pull/103024. Based on the comment from `@scottmcm` https://github.com/rust-lang/rust/pull/103024#pullrequestreview-1248697206. The unmodified `is_ascii_*` functions didn't seem to benefit from extracting the conditions. I've never written a codegen test before, but I tried to check that no branches were emitted. |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |