From: Remi Gacogne Date: Mon, 13 Oct 2025 14:44:15 +0000 (+0200) Subject: iputils: Make static addresses static in `ComboAddress::isUnspecified` X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a4301807428dd4389d9bb43bffea171f5ca3c2ae;p=thirdparty%2Fpdns.git iputils: Make static addresses static in `ComboAddress::isUnspecified` Prevent having to instantiate them again and again, as suggested by Otto. Signed-off-by: Remi Gacogne --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index c567f78950..a533ab3c1b 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -286,9 +286,9 @@ union ComboAddress [[nodiscard]] bool isUnspecified() const { + static const ComboAddress unspecifiedV4("0.0.0.0:0"); + static const ComboAddress unspecifiedV6("[::]:0"); const auto compare = ComboAddress::addressOnlyEqual(); - const ComboAddress unspecifiedV4("0.0.0.0:0"); - const ComboAddress unspecifiedV6("[::]:0"); return compare(*this, unspecifiedV4) || compare(*this, unspecifiedV6); }