mirror of
https://github.com/boostorg/parser.git
synced 2026-01-19 04:22:13 +00:00
Add fast-path for lower case ASCII letters in case_fold
This improved the speed of my parser by approximately 20%
This commit is contained in:
@@ -47,7 +47,10 @@ namespace boost::parser::detail {
|
||||
// One-byte fast path.
|
||||
if (cp < 0x100) {
|
||||
// ASCII letter fast path.
|
||||
if (0x41 <= cp && cp < 0x5a) {
|
||||
if (0x61 <= cp && cp < 0x7a) {
|
||||
*out++ = cp;
|
||||
return out;
|
||||
} else if (0x41 <= cp && cp < 0x5a) {
|
||||
*out++ = cp + 0x20;
|
||||
return out;
|
||||
} else if (cp == 0x00DF) {
|
||||
|
||||
Reference in New Issue
Block a user