From 9c5512b1825ad838af7926587922f2083273a601 Mon Sep 17 00:00:00 2001 From: Felix Brendel Date: Sun, 6 Oct 2019 18:56:34 +0200 Subject: [PATCH] fixed when looping over hm's that deleted objects are iterated over --- hashmap.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hashmap.hpp b/hashmap.hpp index 5b3ccdc..5316586 100644 --- a/hashmap.hpp +++ b/hashmap.hpp @@ -15,8 +15,9 @@ if (key_type key = nullptr); else \ if (void* value = nullptr); else \ for(int index = 0; index < hm->current_capacity; ++index) \ - if (!((key = hm->data[index].original) && \ - (value = hm->data[index].object))); else + if (!((!hm->data[index].deleted) && \ + (key = hm->data[index].original) && \ + (value = hm->data[index].object))); else #define define_hash_map(type, name) \