4af965e732
Slight perf improvement on char::to_ascii_lowercase `char::to_ascii_lowercase()` was checking if it was ascii and then if it was in the right range. Instead propose to check once (I think removing a compare and a shift in the process: [godbolt](https://godbolt.org/z/e5Tora) ). before: ``` test char::methods::bench_to_ascii_lowercase ... bench: 11,196 ns/iter (+/- 632) test char::methods::bench_to_ascii_uppercase ... bench: 11,656 ns/iter (+/- 671) ``` after: ``` test char::methods::bench_to_ascii_lowercase ... bench: 9,612 ns/iter (+/- 979) test char::methods::bench_to_ascii_uppercase ... bench: 8,241 ns/iter (+/- 701) ``` (calling u8::to_ascii_lowercase and letting that flip the 5th bit is also an option, but it's more instructions. I'm thinking for things around ascii and char we want to be as efficient as possible.) |
||
---|---|---|
.. | ||
benches | ||
src | ||
tests | ||
Cargo.toml |