From 0548e1255f5c88782e809f16c4fbf97438e8e1cd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 4 Feb 2020 12:19:24 +0100 Subject: [PATCH] module_util: make GLOBAL_MODULE_NAME constexpr This allows the compiler to hard-code pointers to the string without looking up a global variable at runtime. --- src/module_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module_util.h b/src/module_util.h index 5e1597a987..1186ddcb12 100644 --- a/src/module_util.h +++ b/src/module_util.h @@ -6,7 +6,7 @@ #include -static const char* GLOBAL_MODULE_NAME = "GLOBAL"; +static constexpr const char* GLOBAL_MODULE_NAME = "GLOBAL"; extern std::string extract_module_name(const char* name); extern std::string extract_var_name(const char* name);