AK: Add fast path for constructing StringImpl from "" literal

This commit is contained in:
Andreas Kling 2021-10-25 13:16:59 +02:00
parent 518b8fb292
commit b2f15537bb

View file

@ -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);
}