From fd76e073998908f96e5870ab42e8574ffa799e10 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 4 May 2021 14:45:52 +0300 Subject: [PATCH] LookupServer: Implement DNSName::operator==() --- Userland/Services/LookupServer/DNSName.cpp | 5 +++++ Userland/Services/LookupServer/DNSName.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Userland/Services/LookupServer/DNSName.cpp b/Userland/Services/LookupServer/DNSName.cpp index c50406b024..cb753f6ddb 100644 --- a/Userland/Services/LookupServer/DNSName.cpp +++ b/Userland/Services/LookupServer/DNSName.cpp @@ -74,6 +74,11 @@ void DNSName::randomize_case() m_name = builder.to_string(); } +bool DNSName::operator==(const DNSName& other) const +{ + return as_string() == other.as_string(); +} + OutputStream& operator<<(OutputStream& stream, const DNSName& name) { auto parts = name.as_string().split_view('.'); diff --git a/Userland/Services/LookupServer/DNSName.h b/Userland/Services/LookupServer/DNSName.h index 425d6bcb46..6c6e881d90 100644 --- a/Userland/Services/LookupServer/DNSName.h +++ b/Userland/Services/LookupServer/DNSName.h @@ -23,6 +23,8 @@ public: void randomize_case(); + bool operator==(const DNSName&) const; + class Traits : public AK::Traits { public: static unsigned hash(const DNSName& name);