mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
AK: Add fast path for constructing StringImpl from "" literal
This commit is contained in:
parent
518b8fb292
commit
b2f15537bb
1 changed files with 3 additions and 0 deletions
|
@ -78,6 +78,9 @@ RefPtr<StringImpl> StringImpl::create(const char* cstring, ShouldChomp shouldCho
|
||||||
if (!cstring)
|
if (!cstring)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
if (!*cstring)
|
||||||
|
return the_empty_stringimpl();
|
||||||
|
|
||||||
return create(cstring, strlen(cstring), shouldChomp);
|
return create(cstring, strlen(cstring), shouldChomp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue