diff options
author | Nico Weber <thakis@chromium.org> | 2020-10-05 11:15:49 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-10-05 17:35:27 +0200 |
commit | cc765e14caf24e5a4c28c22aa76fd607e529a0b8 (patch) | |
tree | b6abb12128163b82927269d26bb747046b6a0d0c /Libraries/LibJS | |
parent | ee9c18c118eae28f0a299bb8900df74e66e776d4 (diff) | |
download | serenity-cc765e14caf24e5a4c28c22aa76fd607e529a0b8.zip |
AK: Move StringImpl::operator== implementation into StringImpl
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r-- | Libraries/LibJS/Runtime/StringOrSymbol.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Libraries/LibJS/Runtime/StringOrSymbol.h b/Libraries/LibJS/Runtime/StringOrSymbol.h index bb4aba3e7a..e647b50b0f 100644 --- a/Libraries/LibJS/Runtime/StringOrSymbol.h +++ b/Libraries/LibJS/Runtime/StringOrSymbol.h @@ -30,7 +30,6 @@ #include <LibJS/Runtime/PrimitiveString.h> #include <LibJS/Runtime/Symbol.h> #include <LibJS/Runtime/Value.h> -#include <string.h> namespace JS { @@ -132,9 +131,7 @@ public: return false; auto* this_impl = static_cast<const StringImpl*>(m_ptr); auto* other_impl = static_cast<const StringImpl*>(other.m_ptr); - if (this_impl->length() != other_impl->length()) - return false; - return !memcmp(this_impl->characters(), other_impl->characters(), this_impl->length()); + return *this_impl == *other_impl; } if (is_symbol()) return other.is_symbol() && as_symbol() == other.as_symbol(); |