From: Otto Moerbeek Date: Thu, 14 Apr 2022 07:57:34 +0000 (+0200) Subject: Move to std:::array for name array, as suggested by rgacogne X-Git-Tag: auth-4.8.0-alpha0~141^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11536%2Fhead;p=thirdparty%2Fpdns.git Move to std:::array for name array, as suggested by rgacogne --- diff --git a/pdns/syncres.cc b/pdns/syncres.cc index b13f99e2c1..064efa2b2a 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -300,9 +300,9 @@ struct DoTStatus mutable Status d_status{Unknown}; std::string toString() const { - const std::string n[] = { "Unknown", "Busy", "Bad", "Good"}; + const std::array n{ "Unknown", "Busy", "Bad", "Good" }; unsigned int v = static_cast(d_status); - return v > Status::Good ? "?" : n[v]; + return v >= n.size() ? "?" : n[v]; } };