summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--set.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/set.c b/set.c
index 5195276..e55c7c9 100644
--- a/set.c
+++ b/set.c
@@ -5,7 +5,7 @@
#define DEFAULT_CAPACITY 16
#define TOMBSTONE_VAL ((void*)-1)
-#define IDX_VALID(set, idx) (idx < set->__num_buckets && set->__buckets[idx] != NULL)
+#define IDX_FULL(set, idx) (idx < set->__num_buckets && set->__buckets[idx] != NULL)
void set_init(
set_t* set,
@@ -62,7 +62,7 @@ static size_t fetch_set_idx(
bool set_contains(const set_t* set, const void* key) {
size_t idx = fetch_set_idx(set, key, false);
- return IDX_VALID(set, idx);
+ return IDX_FULL(set, idx);
}
void* set_get(const set_t* set, const void* key) {
@@ -99,7 +99,7 @@ static void rehash_set(set_t* set) {
static size_t fetch_set_idx_rehashing(set_t* set, void* key) {
size_t idx = fetch_set_idx(set, key, false);
- if (IDX_VALID(set, idx)) return idx;
+ if (IDX_FULL(set, idx)) return idx;
idx = fetch_set_idx(set, key, true);
if ((double) ++set->size / set->__num_buckets > set->load_limit