summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@serenityos.org>2021-05-04 14:45:52 +0300
committerAndreas Kling <kling@serenityos.org>2021-05-05 21:16:17 +0200
commitfd76e073998908f96e5870ab42e8574ffa799e10 (patch)
tree0b9b3270ecba694e47048f1d51794c466a3dcf31 /Userland
parent78459b92d50ee24f4312ff050fa8b63f82d0df05 (diff)
downloadserenity-fd76e073998908f96e5870ab42e8574ffa799e10.zip
LookupServer: Implement DNSName::operator==()
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Services/LookupServer/DNSName.cpp5
-rw-r--r--Userland/Services/LookupServer/DNSName.h2
2 files changed, 7 insertions, 0 deletions
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<DNSName> {
public:
static unsigned hash(const DNSName& name);