mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
LibJS: Avoid unnecessary StringImpl copy in StringOrSymbol(String)
This commit is contained in:
parent
5de5af60c1
commit
cfd141b4f9
1 changed files with 3 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue