mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +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)
|
||||
return nullptr;
|
||||
|
||||
if (!*cstring)
|
||||
return the_empty_stringimpl();
|
||||
|
||||
return create(cstring, strlen(cstring), shouldChomp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue