From 38540d89a184e32884d0c3ba1202fc493cba94d1 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 18 Sep 2024 14:21:18 +0300 Subject: [PATCH 1/2] gms: inet_address: drop unused raw_addr method Signed-off-by: Benny Halevy --- gms/inet_address.hh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gms/inet_address.hh b/gms/inet_address.hh index 0dc7766b2b..f49a77d6a2 100644 --- a/gms/inet_address.hh +++ b/gms/inet_address.hh @@ -58,10 +58,6 @@ public: bytes_view bytes() const noexcept { return bytes_view(reinterpret_cast(_addr.data()), _addr.size()); } - // TODO remove - uint32_t raw_addr() const { - return addr().as_ipv4_address().ip; - } friend inline bool operator==(const inet_address& x, const inet_address& y) noexcept = default; friend inline bool operator<(const inet_address& x, const inet_address& y) noexcept { return x.bytes() < y.bytes(); From 5ccdf1cf1c3cab73f9e78802c981e824d0d41aa2 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 18 Sep 2024 14:33:43 +0300 Subject: [PATCH 2/2] gms: inet_address: modernize comparison operators Signed-off-by: Benny Halevy --- gms/inet_address.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gms/inet_address.hh b/gms/inet_address.hh index f49a77d6a2..9ffce574c5 100644 --- a/gms/inet_address.hh +++ b/gms/inet_address.hh @@ -58,9 +58,9 @@ public: bytes_view bytes() const noexcept { return bytes_view(reinterpret_cast(_addr.data()), _addr.size()); } - friend inline bool operator==(const inet_address& x, const inet_address& y) noexcept = default; - friend inline bool operator<(const inet_address& x, const inet_address& y) noexcept { - return x.bytes() < y.bytes(); + constexpr bool operator==(const inet_address&) const noexcept = default; + constexpr auto operator<=>(const inet_address& o) const noexcept { + return bytes() <=> o.bytes(); } friend struct std::hash;