From ea96b321dc57c70ddadd9d69ae431b93e0825513 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@ionos.com>
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 76ee3f4f4..0815cbd15 100644
--- a/src/net/AllocatedSocketAddress.hxx
+++ b/src/net/AllocatedSocketAddress.hxx
@@ -67,12 +67,6 @@ public:
 		return (SocketAddress)*this == std::forward<T>(other);
 	}
 
-	template<typename T>
-	[[gnu::pure]]
-	bool operator!=(T &&other) const noexcept {
-		return !(*this == std::forward<T>(other));
-	}
-
 	[[gnu::const]]
 	static AllocatedSocketAddress Null() noexcept {
 		return AllocatedSocketAddress(nullptr, 0);
diff --git a/src/net/LocalSocketAddress.hxx b/src/net/LocalSocketAddress.hxx
index e6f5ca86d..a9824e0ae 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<const SocketAddress>(*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 36f2bbcbb..b072fb9d3 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 d57dd4ffc..36565a929 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);
-	}
 };