mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01:00
LibJS: Avoid string ref-count churn in PrimitiveString::*_string_view()
This commit is contained in:
parent
24934ba479
commit
cc560a6feb
|
|
@ -146,7 +146,8 @@ String PrimitiveString::utf8_string() const
|
|||
|
||||
StringView PrimitiveString::utf8_string_view() const
|
||||
{
|
||||
(void)utf8_string();
|
||||
if (!has_utf8_string())
|
||||
(void)utf8_string();
|
||||
return m_utf8_string->bytes_as_string_view();
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +165,8 @@ Utf16String PrimitiveString::utf16_string() const
|
|||
|
||||
Utf16View PrimitiveString::utf16_string_view() const
|
||||
{
|
||||
(void)utf16_string();
|
||||
if (!has_utf16_string())
|
||||
(void)utf16_string();
|
||||
return *m_utf16_string;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user