From: Axel Viala Date: Thu, 6 Oct 2022 11:23:10 +0000 (+0200) Subject: [clang-tidy:array] getTypeString std::array instead of char * C array. X-Git-Tag: dnsdist-1.8.0-rc1~140^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07545dbdb6fcde081863017b3497690301f3c375;p=thirdparty%2Fpdns.git [clang-tidy:array] getTypeString std::array instead of char * C array. Apply @Omoerbeek suggestion. char * -> static string & --- diff --git a/pdns/auth-catalogzone.hh b/pdns/auth-catalogzone.hh index ffbb106952..314c648057 100644 --- a/pdns/auth-catalogzone.hh +++ b/pdns/auth-catalogzone.hh @@ -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 types = {"none", "producer", "consumer"}; + return types.at(type); } CatalogInfo() :