mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Add fast path for constructing StringImpl from "" literal
This commit is contained in:
parent
518b8fb292
commit
b2f15537bb
Notes:
sideshowbarker
2024-07-18 01:53:39 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b2f15537bb0
@ -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…
Reference in New Issue
Block a user