mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04: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
261774f070
commit
718d6e6927
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