diff options
author | Andreas Kling <kling@serenityos.org> | 2020-04-05 19:11:39 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-06 08:26:26 +0200 |
commit | 76bb0fab2d6a45962a5fdc2ba54e6c5c6e1c630c (patch) | |
tree | f453cbda926294cc618f15af9b17174423979c5b /AK | |
parent | 6e5c9970bf00dbec7b41db2030f6b613fd2a373f (diff) | |
download | serenity-76bb0fab2d6a45962a5fdc2ba54e6c5c6e1c630c.zip |
AK: Make FlyString a little less hilariously unoptimized :^)
Diffstat (limited to 'AK')
-rw-r--r-- | AK/FlyString.cpp | 6 |
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); } } |