diff --git a/src/hashmap.h b/src/hashmap.h index a1af6cb..1ab2c5d 100644 --- a/src/hashmap.h +++ b/src/hashmap.h @@ -539,7 +539,7 @@ static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531, size_t hash = _map_->hash(key); \ size_t pos = hash % _map_->capacity; \ \ - SNAME##_entry *target = &(_map_->buffer[pos % _map_->capacity]); \ + SNAME##_entry *target = &(_map_->buffer[pos]); \ \ while (target->state == ES_FILLED || target->state == ES_DELETED) \ { \ diff --git a/src/hashset.h b/src/hashset.h index c817834..65809cd 100644 --- a/src/hashset.h +++ b/src/hashset.h @@ -618,7 +618,7 @@ static const size_t cmc_hashtable_primes[] = {53, 97, 191, 383, 769, 1531, size_t hash = _set_->hash(element); \ size_t pos = hash % _set_->capacity; \ \ - SNAME##_entry *target = &(_set_->buffer[pos % _set_->capacity]); \ + SNAME##_entry *target = &(_set_->buffer[pos]); \ \ while (target->state == ES_FILLED || target->state == ES_DELETED) \ { \