From 611457a712e44f0000f8ba337c502881ea245a29 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 14 Apr 2022 09:57:34 +0200 Subject: [PATCH] Move to std:::array for name array, as suggested by rgacogne --- pdns/syncres.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]; } }; -- 2.47.2