mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibJS: Make StringOrSymbol::as_string() return a const reference
No need to copy the FlyString here, we can avoid the ref count churn.
This commit is contained in:
parent
7477002e46
commit
dba1798de7
Notes:
github-actions[bot]
2025-03-27 15:01:55 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/dba1798de7f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4119 Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ public:
|
|||
ALWAYS_INLINE bool is_symbol() const { return is_valid() && (m_bits & 2); }
|
||||
ALWAYS_INLINE bool is_string() const { return is_valid() && !(m_bits & 2); }
|
||||
|
||||
ALWAYS_INLINE FlyString as_string() const
|
||||
ALWAYS_INLINE FlyString const& as_string() const
|
||||
{
|
||||
VERIFY(is_string());
|
||||
return m_string;
|
||||
|
|
Loading…
Add table
Reference in a new issue