]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
[clang-tidy:array] getTypeString std::array<static string> instead of char * C array.
authorAxel Viala <axel.viala@darnuria.eu>
Thu, 6 Oct 2022 11:23:10 +0000 (13:23 +0200)
committerAxel Viala <axel.viala@darnuria.eu>
Sat, 24 Dec 2022 13:36:19 +0000 (14:36 +0100)
Apply @Omoerbeek suggestion. char * -> static string &

pdns/auth-catalogzone.hh

index ffbb106952f647e27056e689bda39644511ededb..314c648057f7c863083896554307302f0cb81a2f 100644 (file)
@@ -41,10 +41,10 @@ public:
     Consumer
   };
 
-  static constexpr const char* getTypeString(enum CatalogType type)
+  static const string& getTypeString(enum CatalogType type)
   {
-    const char* types[] = {"none", "producer", "consumer"};
-    return types[type];
+    static const std::array<const string, 3> types = {"none", "producer", "consumer"};
+    return types.at(type);
   }
 
   CatalogInfo() :