mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Avoid unnecessary StringImpl copy in StringOrSymbol(String)
This commit is contained in:
@@ -51,8 +51,10 @@ public:
|
||||
}
|
||||
|
||||
StringOrSymbol(const String& string)
|
||||
: m_ptr(StringImpl::create(string.characters(), string.length()).leak_ref())
|
||||
: m_ptr(string.impl())
|
||||
{
|
||||
ASSERT(!string.is_null());
|
||||
static_cast<const StringImpl*>(m_ptr)->ref();
|
||||
}
|
||||
|
||||
~StringOrSymbol()
|
||||
|
||||
Reference in New Issue
Block a user