[kutil] Remove uint64_t hash_node specialization

Using a hash of zero to signal an empty slot doesn't play nice with the
hash_node specialization that uses the key for the hash, when 0 is a
common key.

I thought it would be ok, that it'd just be something to remember. But
then I used 0 as a key anyway, so clearly it was a bad idea.
This commit is contained in:
Justin C. Miller
2021-01-06 23:09:50 -08:00
parent cd30126f17
commit 8b3356e9d8

View File

@@ -45,20 +45,6 @@ struct hash_node
inline uint64_t hash() const { return h; } inline uint64_t hash() const { return h; }
}; };
template <typename V>
struct hash_node <uint64_t, V>
{
uint64_t key;
V val;
hash_node(hash_node &&o) : key(std::move(o.key)), val(std::move(o.val)) {}
hash_node(uint64_t h, uint64_t &&k, V &&v) : key(std::move(k)), val(std::move(v)) {}
~hash_node() {}
inline uint64_t & hash() { return key; }
inline uint64_t hash() const { return key; }
};
/// Base class for hash maps /// Base class for hash maps
template <typename K, typename V> template <typename K, typename V>
class base_map class base_map