1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 02:28:12 +00:00

AK: Move StringImpl::operator== implementation into StringImpl

This commit is contained in:
Nico Weber 2020-10-05 11:15:49 -04:00 committed by Andreas Kling
parent ee9c18c118
commit cc765e14ca
3 changed files with 9 additions and 8 deletions

View file

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