summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-04-05 19:11:39 +0200
committerAndreas Kling <kling@serenityos.org>2020-04-06 08:26:26 +0200
commit76bb0fab2d6a45962a5fdc2ba54e6c5c6e1c630c (patch)
treef453cbda926294cc618f15af9b17174423979c5b /AK
parent6e5c9970bf00dbec7b41db2030f6b613fd2a373f (diff)
downloadserenity-76bb0fab2d6a45962a5fdc2ba54e6c5c6e1c630c.zip
AK: Make FlyString a little less hilariously unoptimized :^)
Diffstat (limited to 'AK')
-rw-r--r--AK/FlyString.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/AK/FlyString.cpp b/AK/FlyString.cpp
index 36f5c8a241..c537ac14e6 100644
--- a/AK/FlyString.cpp
+++ b/AK/FlyString.cpp
@@ -118,7 +118,11 @@ bool FlyString::operator==(const StringView& string) const
bool FlyString::operator==(const char* string) const
{
- return String(string) == String(m_impl.ptr());
+ if (is_null())
+ return !string;
+ if (!string)
+ return false;
+ return !__builtin_strcmp(m_impl->characters(), string);
}
}