From db3173ba9aca06cb9d07f0ca23ab722ff7114300 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 Jul 2024 16:49:37 +0200 Subject: [PATCH] net/SocketAdddress: remove unnecessary operator!=() The compiler must generate this implicitly from operator==(). --- src/net/AllocatedSocketAddress.hxx | 6 ------ src/net/LocalSocketAddress.hxx | 5 ----- src/net/SocketAddress.hxx | 4 ---- src/net/StaticSocketAddress.hxx | 4 ---- 4 files changed, 19 deletions(-) diff --git a/src/net/AllocatedSocketAddress.hxx b/src/net/AllocatedSocketAddress.hxx index 76ee3f4f..0815cbd1 100644 --- a/src/net/AllocatedSocketAddress.hxx +++ b/src/net/AllocatedSocketAddress.hxx @@ -67,12 +67,6 @@ public: return (SocketAddress)*this == std::forward(other); } - template - [[gnu::pure]] - bool operator!=(T &&other) const noexcept { - return !(*this == std::forward(other)); - } - [[gnu::const]] static AllocatedSocketAddress Null() noexcept { return AllocatedSocketAddress(nullptr, 0); diff --git a/src/net/LocalSocketAddress.hxx b/src/net/LocalSocketAddress.hxx index e6f5ca86..a9824e0a 100644 --- a/src/net/LocalSocketAddress.hxx +++ b/src/net/LocalSocketAddress.hxx @@ -121,9 +121,4 @@ public: bool operator==(SocketAddress other) const noexcept { return static_cast(*this) == other; } - - [[nodiscard]] [[gnu::pure]] - bool operator!=(SocketAddress other) const noexcept { - return !(*this == other); - } }; diff --git a/src/net/SocketAddress.hxx b/src/net/SocketAddress.hxx index 36f2bbcb..b072fb9d 100644 --- a/src/net/SocketAddress.hxx +++ b/src/net/SocketAddress.hxx @@ -169,8 +169,4 @@ public: [[gnu::pure]] bool operator==(const SocketAddress other) const noexcept; - - bool operator!=(const SocketAddress other) const noexcept { - return !(*this == other); - } }; diff --git a/src/net/StaticSocketAddress.hxx b/src/net/StaticSocketAddress.hxx index d57dd4ff..36565a92 100644 --- a/src/net/StaticSocketAddress.hxx +++ b/src/net/StaticSocketAddress.hxx @@ -141,8 +141,4 @@ public: bool operator==(SocketAddress other) const noexcept { return (SocketAddress)*this == other; } - - bool operator!=(SocketAddress other) const noexcept { - return !(*this == other); - } };