summaryrefslogtreecommitdiff
path: root/Servers/LookupServer
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-03-06 10:26:05 +0100
committerAndreas Kling <kling@serenityos.org>2020-03-06 10:32:58 +0100
commit8bb361889c3c37dbaa0254bb9a76dcd94aeab115 (patch)
tree28c937882baff5050424733d729e57cc4d238b4b /Servers/LookupServer
parentae233c1e82afd7a85741c3f7ea986f9b64dd69bd (diff)
downloadserenity-8bb361889c3c37dbaa0254bb9a76dcd94aeab115.zip
AK: Remove Optional::operator bool()
This was causing some obvious-in-hindsight but hard to spot bugs where we'd implicitly convert the bool to an integer type and carry on with the number 1 instead of the actual value().
Diffstat (limited to 'Servers/LookupServer')
-rw-r--r--Servers/LookupServer/LookupServer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Servers/LookupServer/LookupServer.cpp b/Servers/LookupServer/LookupServer.cpp
index 42522ba49d..3d466cb231 100644
--- a/Servers/LookupServer/LookupServer.cpp
+++ b/Servers/LookupServer/LookupServer.cpp
@@ -117,7 +117,7 @@ void LookupServer::service_client(RefPtr<Core::LocalSocket> socket)
Vector<String> responses;
- if (auto known_host = m_etc_hosts.get(hostname)) {
+ if (auto known_host = m_etc_hosts.get(hostname); known_host.has_value()) {
responses.append(known_host.value());
} else if (!hostname.is_empty()) {
bool did_timeout;