From 7a3aa02dc14ee9f5f40286f36d39d08ec910a29e Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sun, 18 Aug 2019 05:19:11 +0300 Subject: [PATCH] StrFmt.h: remove some dead code with UB Global variable is unused but written concurrently. --- Utilities/StrFmt.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Utilities/StrFmt.h b/Utilities/StrFmt.h index 6183460519..7071a69d37 100644 --- a/Utilities/StrFmt.h +++ b/Utilities/StrFmt.h @@ -140,18 +140,9 @@ struct fmt_class_string // Enum -> string function type using convert_t = const char*(*)(T value); - // Enum -> string function registered - static convert_t convert_enum; - // Helper function (safely converts arg to enum value) static SAFE_BUFFERS FORCE_INLINE void format_enum(std::string& out, u64 arg, convert_t convert) { - // Save convert function - if (convert_enum == nullptr) - { - convert_enum = convert; - } - const auto value = static_cast>(arg); // Check narrowing @@ -203,9 +194,6 @@ struct fmt_class_string static constexpr const char* unknown = nullptr; }; -template -const char*(*fmt_class_string::convert_enum)(T) = nullptr; - template <> struct fmt_class_string {