aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-07-22 10:54:17 +0200
committerMax Kellermann <max@duempel.org>2015-07-22 10:56:32 +0200
commit20d69b957f44b07dac13f140d35684810e34a301 (patch)
tree7beef1bc3b7db267ca97f445433f8d54d415b0b1
parent7de0a621e3a33b25a62d875670380d33dbd977f5 (diff)
downloadmpd-20d69b957f44b07dac13f140d35684810e34a301.tar.gz
mpd-20d69b957f44b07dac13f140d35684810e34a301.tar.xz
mpd-20d69b957f44b07dac13f140d35684810e34a301.zip
Net/StaticSocketAddress: add equality operator with SocketAddress
-rw-r--r--src/net/StaticSocketAddress.cxx7
-rw-r--r--src/net/StaticSocketAddress.hxx6
2 files changed, 4 insertions, 9 deletions
diff --git a/src/net/StaticSocketAddress.cxx b/src/net/StaticSocketAddress.cxx
index 27de7f6f5..94db4a49c 100644
--- a/src/net/StaticSocketAddress.cxx
+++ b/src/net/StaticSocketAddress.cxx
@@ -41,10 +41,3 @@ StaticSocketAddress::operator=(SocketAddress other)
memcpy(&address, other.GetAddress(), size);
return *this;
}
-
-bool
-StaticSocketAddress::operator==(const StaticSocketAddress &other) const
-{
- return size == other.size &&
- memcmp(&address, &other.address, size) == 0;
-}
diff --git a/src/net/StaticSocketAddress.hxx b/src/net/StaticSocketAddress.hxx
index 0a780f6f6..c8cef9dfe 100644
--- a/src/net/StaticSocketAddress.hxx
+++ b/src/net/StaticSocketAddress.hxx
@@ -92,9 +92,11 @@ public:
}
gcc_pure
- bool operator==(const StaticSocketAddress &other) const;
+ bool operator==(SocketAddress other) const {
+ return (SocketAddress)*this == other;
+ }
- bool operator!=(const StaticSocketAddress &other) const {
+ bool operator!=(SocketAddress &other) const {
return !(*this == other);
}
};