summary refs log tree commit diff
path: root/lib/hashtable.c
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-04 15:31:34 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2025-01-04 16:06:04 +0100
commit86f5a16173ee5a8e22130defca58b03a6b997354 (patch)
treefcc6aa3c55f132c888f3c75235353f469789fa65 /lib/hashtable.c
parentvariable ht capacity in fuzzing (diff)
downloadc-hashtable-86f5a16173ee5a8e22130defca58b03a6b997354.tar.gz
c-hashtable-86f5a16173ee5a8e22130defca58b03a6b997354.tar.bz2
c-hashtable-86f5a16173ee5a8e22130defca58b03a6b997354.zip
Start implementing referencing hashmap impl in fuzzer
Diffstat (limited to 'lib/hashtable.c')
-rw-r--r--lib/hashtable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/hashtable.c b/lib/hashtable.c
index 2015b9c..e7799ad 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -108,9 +108,9 @@ int hashtable_remove(HashTable ht, char* key) {
 
 	for (int i = 0; i < bucket->length; ++i) {
 		HashTableData* data = &bucket->data[i];
-		if (strcmp(data->key, key) == 0) {
+		if (!data->deleted && strcmp(data->key, key) == 0) {
 			data->deleted = 1;
-			return 0;
+			return 1;
 		}
 	}