mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibJS+Everywhere: Return strings by value from PrimitiveString
It turns out return a ThrowCompletionOr<T const&> is flawed, as the GCC expansion trick used with TRY will always make a copy. PrimitiveString is luckily the only such use case.
This commit is contained in:
parent
9a120d7243
commit
a59ebdac2d
Notes:
sideshowbarker
2024-07-17 18:13:59 +09:00
Author: https://github.com/trflynn89
Commit: a59ebdac2d
Pull-request: https://github.com/SerenityOS/serenity/pull/16999
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/linusg ✅
10 changed files with 22 additions and 21 deletions
|
@ -34,10 +34,10 @@ public:
|
|||
bool is_empty() const;
|
||||
u32 hash() const;
|
||||
|
||||
ThrowCompletionOr<DeprecatedString const&> deprecated_string() const;
|
||||
ThrowCompletionOr<DeprecatedString> deprecated_string() const;
|
||||
bool has_utf8_string() const { return m_utf8_string.has_value(); }
|
||||
|
||||
ThrowCompletionOr<Utf16String const&> utf16_string() const;
|
||||
ThrowCompletionOr<Utf16String> utf16_string() const;
|
||||
ThrowCompletionOr<Utf16View> utf16_string_view() const;
|
||||
bool has_utf16_string() const { return m_utf16_string.has_value(); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue