Fix use after move in HashMap::insert

Apparently GCC builds worked fine but Clang builds started failing the
"(hash == hash_value(item_key(item)))" assertion.
This commit is contained in:
Johannes Altmanninger 2023-11-18 19:07:23 +01:00
parent 296ab1a1ff
commit 4499b26ca4

View File

@ -214,7 +214,8 @@ struct HashMap
constexpr EffectiveValue& insert(Item item) constexpr EffectiveValue& insert(Item item)
{ {
return insert(std::move(item), hash_value(item_key(item))); const auto hash = hash_value(item_key(item));
return insert(std::move(item), hash);
} }
template<typename KeyType> requires IsHashCompatible<Key, KeyType> template<typename KeyType> requires IsHashCompatible<Key, KeyType>