diff --git a/util.d b/util.d index 0898195..a9ffd49 100644 --- a/util.d +++ b/util.d @@ -406,7 +406,7 @@ Push(K, V)(HashTable!(K, V)* ht, K key, V value) N* node = ht.nil; - if (CheckNil(ht.nil, ht.free_lists.first)) + if (!CheckNil(ht.nil, ht.free_lists.first)) { node = SLLPop(&ht.free_lists, ht.nil); } @@ -432,7 +432,7 @@ Search(K, V)(HashTable!(K, V)* ht, K key) KVPair!(K, V)* result = null; auto list = GetList(ht, key); - for(auto node = list.first; CheckNil(ht.nil, node); node = node.next) + for(auto node = list.first; !CheckNil(ht.nil, node); node = node.next) { if (node.value.key == key) { @@ -459,7 +459,7 @@ Delete(K, V)(HashTable!(K, V)* ht, K key) auto list = GetList(ht, key); auto prev = ht.nil; - for(auto node = list.first; CheckNil(ht.nil, node); node = node.next) + for(auto node = list.first; !CheckNil(ht.nil, node); node = node.next) { if (node.value.key == key) {