1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:57:44 +00:00

AK: Move identity check from URL::operator==() to equals()

This commit is contained in:
Max Wipfli 2021-06-01 11:14:30 +02:00 committed by Andreas Kling
parent 33396494f6
commit 2e23954271
2 changed files with 3 additions and 6 deletions

View file

@ -327,6 +327,8 @@ String URL::serialize_for_display() const
bool URL::equals(URL const& other, ExcludeFragment exclude_fragments) const bool URL::equals(URL const& other, ExcludeFragment exclude_fragments) const
{ {
if (this == &other)
return true;
if (!m_valid || !other.m_valid) if (!m_valid || !other.m_valid)
return false; return false;
return serialize(exclude_fragments) == other.serialize(exclude_fragments); return serialize(exclude_fragments) == other.serialize(exclude_fragments);

View file

@ -101,12 +101,7 @@ public:
static String percent_encode(StringView const& input, PercentEncodeSet set = PercentEncodeSet::Userinfo); static String percent_encode(StringView const& input, PercentEncodeSet set = PercentEncodeSet::Userinfo);
static String percent_decode(StringView const& input); static String percent_decode(StringView const& input);
bool operator==(URL const& other) const bool operator==(URL const& other) const { return equals(other, ExcludeFragment::No); }
{
if (this == &other)
return true;
return equals(other, ExcludeFragment::No);
}
private: private:
URL(String&& data_mime_type, String&& data_payload, bool payload_is_base64) URL(String&& data_mime_type, String&& data_payload, bool payload_is_base64)