Skip to content

Commit

Permalink
Too ashamed for a commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
kstppd committed Oct 23, 2023
1 parent dbd45e9 commit 53c656e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/hashinator/hashinator.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class Hashmap {
auto hashIndex = hash(key);

// Try to find the matching bucket.
for (size_t i = 0; i < _mapInfo->currentMaxBucketOverflow; i++) {
for (size_t i = 0; i <= _mapInfo->currentMaxBucketOverflow; i++) {

hash_pair<KEY_TYPE, VAL_TYPE>& candidate = buckets[(hashIndex + i) & bitMask];

Expand All @@ -299,7 +299,7 @@ class Hashmap {
// We look ahead in case candidate was already in the hashmap
// If we find it then we swap the duplicate with empty and do not increment fill
// but we only reduce the tombstone count
for (size_t j = i + 1; j < _mapInfo->currentMaxBucketOverflow; ++j) {
for (size_t j = i + 1; j <= _mapInfo->currentMaxBucketOverflow; ++j) {
hash_pair<KEY_TYPE, VAL_TYPE>& duplicate = buckets[(hashIndex + j) & bitMask];
if (duplicate.first == candidate.first) {
alreadyExists = true;
Expand Down Expand Up @@ -336,7 +336,7 @@ class Hashmap {
auto hashIndex = hash(key);

// Try to find the matching bucket.
for (size_t i = 0; i < _mapInfo->currentMaxBucketOverflow; i++) {
for (size_t i = 0; i <= _mapInfo->currentMaxBucketOverflow; i++) {
const hash_pair<KEY_TYPE, VAL_TYPE>& candidate = buckets[(hashIndex + i) & bitMask];

if (candidate.first == TOMBSTONE) {
Expand Down Expand Up @@ -623,7 +623,7 @@ class Hashmap {
auto hashIndex = hash(key);

// Try to find the matching bucket.
for (size_t i = 0; i < _mapInfo->currentMaxBucketOverflow; i++) {
for (size_t i = 0; i <= _mapInfo->currentMaxBucketOverflow; i++) {
const hash_pair<KEY_TYPE, VAL_TYPE>& candidate = buckets[(hashIndex + i) & bitMask];

if (candidate.first == TOMBSTONE) {
Expand Down Expand Up @@ -651,7 +651,7 @@ class Hashmap {
auto hashIndex = hash(key);

// Try to find the matching bucket.
for (size_t i = 0; i < _mapInfo->currentMaxBucketOverflow; i++) {
for (size_t i = 0; i <= _mapInfo->currentMaxBucketOverflow; i++) {
const hash_pair<KEY_TYPE, VAL_TYPE>& candidate = buckets[(hashIndex + i) & bitMask];

if (candidate.first == TOMBSTONE) {
Expand Down Expand Up @@ -1383,7 +1383,7 @@ class Hashmap {
auto hashIndex = hash(key);

// Try to find the matching bucket.
for (size_t i = 0; i < _mapInfo->currentMaxBucketOverflow; i++) {
for (size_t i = 0; i <= _mapInfo->currentMaxBucketOverflow; i++) {
const hash_pair<KEY_TYPE, VAL_TYPE>& candidate = buckets[(hashIndex + i) & bitMask];

if (candidate.first == TOMBSTONE) {
Expand Down Expand Up @@ -1411,7 +1411,7 @@ class Hashmap {
auto hashIndex = hash(key);

// Try to find the matching bucket.
for (size_t i = 0; i < _mapInfo->currentMaxBucketOverflow; i++) {
for (size_t i = 0; i <= _mapInfo->currentMaxBucketOverflow; i++) {
const hash_pair<KEY_TYPE, VAL_TYPE>& candidate = buckets[(hashIndex + i) & bitMask];

if (candidate.first == TOMBSTONE) {
Expand Down Expand Up @@ -1557,7 +1557,7 @@ class Hashmap {
auto hashIndex = hash(key);

// Try to find the matching bucket.
for (size_t i = 0; i < _mapInfo->currentMaxBucketOverflow; i++) {
for (size_t i = 0; i <= _mapInfo->currentMaxBucketOverflow; i++) {
uint32_t vecindex = (hashIndex + i) & bitMask;
const hash_pair<KEY_TYPE, VAL_TYPE>& candidate = buckets[vecindex];
if (candidate.first == key) {
Expand Down

0 comments on commit 53c656e

Please sign in to comment.