mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-29 05:38:24 +00:00
LibJS: Reduce copying of string data in RegExp.prototype
In addition to invoking js_string() with existing UTF-16 strings when possible, RegExpExec now takes a Utf16String instead of a Utf16View. The view was previously fully copied into the returned result object, so this prevents potentially large copies of string data.
This commit is contained in:
parent
6c45620709
commit
34bd25f6c2
Notes:
sideshowbarker
2024-07-18 07:08:19 +09:00
Author: https://github.com/trflynn89
Commit: 34bd25f6c2
Pull-request: https://github.com/SerenityOS/serenity/pull/9320
Reviewed-by: https://github.com/davidot ✅
4 changed files with 39 additions and 49 deletions
|
@ -22,7 +22,7 @@ public:
|
|||
virtual ~RegExpStringIterator() override = default;
|
||||
|
||||
Object& regexp_object() { return m_regexp_object; }
|
||||
Utf16View string() const { return m_string.view(); }
|
||||
Utf16String string() const { return m_string; }
|
||||
bool global() const { return m_global; }
|
||||
bool unicode() const { return m_unicode; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue