diff options
| author | Maxime Coste <mawww@kakoune.org> | 2024-02-11 12:17:21 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2024-02-11 12:17:21 +1100 |
| commit | bd91a255e49c81e3d20c43359facac95191e041a (patch) | |
| tree | f59f0f609e397d477fae6c46bc53d0b4295f29da /src | |
| parent | 8d60e19484d9cd5a49ed6d84c84f522092601d9f (diff) | |
Do not decode utf8 while looking for next regex match start candidate
If the first byte in the multi-byte utf8 sequence does not match,
it means the "other" character is not set, so none of the sequence
byte will match (as they are all with the MSB set). This tightens
the critical loop which ends up running faster in most cases.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex_impl.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regex_impl.hh b/src/regex_impl.hh index f59b2249..2fd2254a 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -530,7 +530,7 @@ private: const unsigned char c = *start; if (start_desc.map[(c < StartDesc::count) ? c : StartDesc::other]) return; - utf8::to_next(start, config.end); + ++start; } else { |
