From 45a9b539ff6ca19c0cf620085cde6ca192c2ff24 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 2 Sep 2025 02:47:33 +1000 Subject: [PATCH] actually fix nil checks --- util.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) {