[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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user