mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibRegex: Avoid pointlessly slicing a UTF-16 string for one code unit
This simple change is a nice 9% speedup on the regex test suite :^)
This commit is contained in:
parent
17bff999c8
commit
fbab9bc330
Notes:
sideshowbarker
2024-07-17 07:14:09 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/fbab9bc330 Pull-request: https://github.com/SerenityOS/serenity/pull/20015
1 changed files with 1 additions and 1 deletions
|
@ -559,7 +559,7 @@ ALWAYS_INLINE ExecutionResult OpCode_Compare::execute(MatchInput const& input, M
|
|||
auto range_data = m_bytecode->template spans<4>().slice(offset, count);
|
||||
offset += count;
|
||||
|
||||
auto ch = input.view.substring_view(state.string_position, 1)[0];
|
||||
auto ch = input.view[state.string_position_in_code_units];
|
||||
|
||||
auto const* matching_range = binary_search(range_data, ch, nullptr, [insensitive = input.regex_options & AllFlags::Insensitive](auto needle, CharRange range) {
|
||||
auto upper_case_needle = needle;
|
||||
|
|
Loading…
Reference in a new issue