From 52f36fc5a0132f0465d14479f30304ba03d5b85a Mon Sep 17 00:00:00 2001 From: neargye Date: Sun, 29 Sep 2019 17:47:54 +0500 Subject: [PATCH] removed definition that used only once --- include/magic_enum.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 5fd04f6..1c04376 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -251,9 +251,6 @@ inline constexpr std::size_t count_v = count(range_v); template inline constexpr auto sequence_v = std::make_index_sequence>{}; -template -inline constexpr bool sparsity_v = count_v != size_v; - template constexpr auto values(std::integer_sequence) noexcept { static_assert(is_enum_v, "magic_enum::detail::values requires enum type."); @@ -387,7 +384,7 @@ struct enum_traits>> { [[nodiscard]] static constexpr int index(E value) noexcept { if (static_cast(value) >= static_cast(detail::min_v) && static_cast(value) <= static_cast(detail::max_v)) { - if constexpr (detail::sparsity_v) { + if constexpr (detail::size_v != detail::count_v) { if (auto i = indexes[static_cast(value) - detail::min_v]; i != detail::invalid_index_v) { return i; }