mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 10:05:32 +00:00
AK: Add fast path for constructing StringImpl from "" literal
This commit is contained in:
parent
518b8fb292
commit
b2f15537bb
|
@ -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…
Reference in a new issue