From 7ce795494d10d64f527f5a6076789d20f2f87091 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Wed, 10 Jul 2024 10:34:22 +0300 Subject: Fixed bug in `hset_at` function --- include/container.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/container.h') diff --git a/include/container.h b/include/container.h index 6ac9054..db4fa4f 100644 --- a/include/container.h +++ b/include/container.h @@ -1278,7 +1278,7 @@ char hset_insert_mallocated(struct hash_set* set, void* element) { } void* hset_at(struct hash_set* set, void* element) { size_t index = set->hash(element) % array_size(set->buckets); - if (ll_search(set->buckets, element, set->eq)) + if (ll_search(set->buckets + index, element, set->eq)) return ll_find(set->buckets + index, element, set->eq)->data; return NULL; } -- cgit v1.2.3-70-g09d2