[PATCH 3/3] libstdc++: Optimize std::regex_traits lookup functions
Jonathan Wakely
jwakely@redhat.com
Tue Feb 10 14:12:31 GMT 2026
On Tue, 10 Feb 2026 at 14:07, Tomasz Kaminski <tkaminsk@redhat.com> wrote:
>>
>> + {
>> + case 'a':
>> + if (__read_ch() == 'l')
>> + switch (__read_ch())
>> + {
>> + case 'n':
>> + if (__match("um"))
>
> I think adding comments like if (__match("um")) // alnum, would really
> help here. I think they really helps for this two cases, but would
> add them everywhere...
>>
>> + return ctype_base::alnum;
>> + break;
>> + case 'p':
>> + if (__match("ha"))
>>
>> + return ctype_base::alpha;
>> + break;
>> + }
>> + break;
>> + case 'b':
>> + if (__match("lank"))
>> + return ctype_base::blank;
>> + break;
>> + case 'c':
>> + if (__match("ntrl"))
>> + return ctype_base::cntrl;
>> + break;
>> + case 'd':
>> + if (__first == __last || __match("igit"))
>
> And say // d or digit here.
Yes, this would be helpful. I'll add those comments.
More information about the Libstdc++
mailing list