]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move to std:::array for name array, as suggested by rgacogne 11536/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 14 Apr 2022 07:57:34 +0000 (09:57 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 14 Apr 2022 07:57:34 +0000 (09:57 +0200)
pdns/syncres.cc

index b13f99e2c1858c5da423d7c77385646684a0cf36..064efa2b2a361a023d6855f53fc10871aea8aea7 100644 (file)
@@ -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<std::string, 4> n{ "Unknown", "Busy", "Bad", "Good" };
     unsigned int v = static_cast<unsigned int>(d_status);
-    return v > Status::Good ? "?" : n[v];
+    return v >= n.size() ? "?" : n[v];
   }
 };