mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-17 16:28:06 +03:00
AK: Move identity check from URL::operator==() to equals()
This commit is contained in:
parent
33396494f6
commit
2e23954271
Notes:
sideshowbarker
2024-07-18 17:03:14 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/2e23954271a Pull-request: https://github.com/SerenityOS/serenity/pull/7658
@ -327,6 +327,8 @@ String URL::serialize_for_display() const
|
||||
|
||||
bool URL::equals(URL const& other, ExcludeFragment exclude_fragments) const
|
||||
{
|
||||
if (this == &other)
|
||||
return true;
|
||||
if (!m_valid || !other.m_valid)
|
||||
return false;
|
||||
return serialize(exclude_fragments) == other.serialize(exclude_fragments);
|
||||
|
7
AK/URL.h
7
AK/URL.h
@ -101,12 +101,7 @@ public:
|
||||
static String percent_encode(StringView const& input, PercentEncodeSet set = PercentEncodeSet::Userinfo);
|
||||
static String percent_decode(StringView const& input);
|
||||
|
||||
bool operator==(URL const& other) const
|
||||
{
|
||||
if (this == &other)
|
||||
return true;
|
||||
return equals(other, ExcludeFragment::No);
|
||||
}
|
||||
bool operator==(URL const& other) const { return equals(other, ExcludeFragment::No); }
|
||||
|
||||
private:
|
||||
URL(String&& data_mime_type, String&& data_payload, bool payload_is_base64)
|
||||
|
Loading…
Reference in New Issue
Block a user