mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-26 20:26:53 +00:00
LibRegex: Don't use Optional<T> inside regex::Match
This prevented Match from being trivially copyable, which we want it to be for fast Vector copying.
This commit is contained in:
parent
54edf29f1b
commit
5308d77600
Notes:
github-actions[bot]
2025-04-14 15:41:20 +00:00
Author: https://github.com/awesomekling
Commit: 5308d77600
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4351
3 changed files with 11 additions and 8 deletions
|
@ -502,7 +502,7 @@ public:
|
|||
void reset()
|
||||
{
|
||||
view = view.typed_null_view();
|
||||
capture_group_name.clear();
|
||||
capture_group_name = -1;
|
||||
line = 0;
|
||||
column = 0;
|
||||
global_offset = 0;
|
||||
|
@ -510,7 +510,10 @@ public:
|
|||
}
|
||||
|
||||
RegexStringView view {};
|
||||
Optional<size_t> capture_group_name {}; // This is a string table index.
|
||||
|
||||
// This is a string table index. -1 if none. Not using Optional to keep the struct trivially copyable.
|
||||
ssize_t capture_group_name { -1 };
|
||||
|
||||
size_t line { 0 };
|
||||
size_t column { 0 };
|
||||
size_t global_offset { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue