mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:17:34 +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
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