From 8b3356e9d836be86890fe07427bdc32817af396c Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Wed, 6 Jan 2021 23:09:50 -0800 Subject: [PATCH] [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. --- src/libraries/kutil/include/kutil/map.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/libraries/kutil/include/kutil/map.h b/src/libraries/kutil/include/kutil/map.h index 9536e61..4ea1ddf 100644 --- a/src/libraries/kutil/include/kutil/map.h +++ b/src/libraries/kutil/include/kutil/map.h @@ -45,20 +45,6 @@ struct hash_node inline uint64_t hash() const { return h; } }; -template -struct hash_node -{ - 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 template class base_map