diff --git a/include/nlohmann/detail/hash.hpp b/include/nlohmann/detail/hash.hpp index 9df26dcb8..5e3f9ef02 100644 --- a/include/nlohmann/detail/hash.hpp +++ b/include/nlohmann/detail/hash.hpp @@ -188,8 +188,7 @@ std::size_t hash(const BasicJsonType& j) case BasicJsonType::value_t::number_float: { const auto h = std::hash {}(j.template get()); - const auto numeric_type = static_cast(BasicJsonType::value_t::number_float); - return combine(numeric_type, h); + return combine(type, h); } case BasicJsonType::value_t::binary: diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 4b233ed5c..438973ef4 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -6856,8 +6856,7 @@ std::size_t hash(const BasicJsonType& j) case BasicJsonType::value_t::number_float: { const auto h = std::hash {}(j.template get()); - const auto numeric_type = static_cast(BasicJsonType::value_t::number_float); - return combine(numeric_type, h); + return combine(type, h); } case BasicJsonType::value_t::binary: