From f8529d4fe694cce45b2924f897507f1ec2ada1ae Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 29 Apr 2024 16:41:45 +0200 Subject: [PATCH] net/{Allocated,Static}SocketAddress: inline GetLocalRaw() --- src/net/AllocatedSocketAddress.cxx | 6 ------ src/net/AllocatedSocketAddress.hxx | 4 +++- src/net/StaticSocketAddress.cxx | 10 ---------- src/net/StaticSocketAddress.hxx | 4 +++- 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/net/AllocatedSocketAddress.cxx b/src/net/AllocatedSocketAddress.cxx index 6b27e6e26..4ca985d09 100644 --- a/src/net/AllocatedSocketAddress.cxx +++ b/src/net/AllocatedSocketAddress.cxx @@ -37,12 +37,6 @@ AllocatedSocketAddress::SetSize(size_type new_size) noexcept #ifdef HAVE_UN -std::string_view -AllocatedSocketAddress::GetLocalRaw() const noexcept -{ - return SocketAddress(*this).GetLocalRaw(); -} - void AllocatedSocketAddress::SetLocal(const char *path) noexcept { diff --git a/src/net/AllocatedSocketAddress.hxx b/src/net/AllocatedSocketAddress.hxx index 7e8869fbf..76ee3f4f4 100644 --- a/src/net/AllocatedSocketAddress.hxx +++ b/src/net/AllocatedSocketAddress.hxx @@ -125,7 +125,9 @@ public: * @see SocketAddress::GetLocalRaw() */ [[gnu::pure]] - std::string_view GetLocalRaw() const noexcept; + std::string_view GetLocalRaw() const noexcept { + return static_cast(*this).GetLocalRaw(); + } /** * @see SocketAddress::GetLocalPath() diff --git a/src/net/StaticSocketAddress.cxx b/src/net/StaticSocketAddress.cxx index 4510d84b0..36e8bc7f0 100644 --- a/src/net/StaticSocketAddress.cxx +++ b/src/net/StaticSocketAddress.cxx @@ -17,16 +17,6 @@ StaticSocketAddress::operator=(SocketAddress other) noexcept return *this; } -#ifdef HAVE_UN - -std::string_view -StaticSocketAddress::GetLocalRaw() const noexcept -{ - return SocketAddress(*this).GetLocalRaw(); -} - -#endif - #ifdef HAVE_TCP bool diff --git a/src/net/StaticSocketAddress.hxx b/src/net/StaticSocketAddress.hxx index 28398f37d..d57dd4ffc 100644 --- a/src/net/StaticSocketAddress.hxx +++ b/src/net/StaticSocketAddress.hxx @@ -103,7 +103,9 @@ public: * @see SocketAddress::GetLocalRaw() */ [[gnu::pure]] - std::string_view GetLocalRaw() const noexcept; + std::string_view GetLocalRaw() const noexcept { + return static_cast(*this).GetLocalRaw(); + } /** * @see SocketAddress::GetLocalPath()