From a1ac692b4977b84297f98eb9179e0632ff61b81e Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 20 Jan 2024 17:22:56 -0600 Subject: [PATCH] use reference syntax (#1430) --- dCommon/dEnums/StringifiedEnum.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dCommon/dEnums/StringifiedEnum.h b/dCommon/dEnums/StringifiedEnum.h index 16eafdca..1816d705 100644 --- a/dCommon/dEnums/StringifiedEnum.h +++ b/dCommon/dEnums/StringifiedEnum.h @@ -9,15 +9,15 @@ namespace StringifiedEnum { const std::string_view ToString(const T e) { static_assert(std::is_enum_v, "Not an enum"); // Check type - constexpr auto sv = &magic_enum::enum_entries(); + constexpr auto& sv = magic_enum::enum_entries(); const auto it = std::lower_bound( - sv->begin(), sv->end(), e, + sv.begin(), sv.end(), e, [&](const std::pair& lhs, const T rhs) { return lhs.first < rhs; } ); std::string_view output; - if (it != sv->end() && it->first == e) { + if (it != sv.end() && it->first == e) { output = it->second; } else { output = "UNKNOWN";