Browse Source

CANN: Make `valid_values` variable `static const` (#18627)

Raul Torres 3 weeks ago
parent
commit
da9b8d3300
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ggml/src/ggml-cann/ggml-cann.cpp

+ 1 - 1
ggml/src/ggml-cann/ggml-cann.cpp

@@ -122,7 +122,7 @@ std::optional<std::string> get_env(const std::string & name) {
  * @brief Verify whether the environment variable is a valid value.
  */
 bool parse_bool(const std::string & value) {
-    std::unordered_set<std::string> valid_values = { "on", "1", "yes", "y", "enable", "true" };
+    static const std::unordered_set<std::string> valid_values = { "on", "1", "yes", "y", "enable", "true" };
     return valid_values.find(value) != valid_values.end();
 }