I suggest improving the probing a little. Something like
idx = (idx + 1) % map->cap;
iterCount++; idx = (idx + iterCount) % map->cap;
It could be improved even more, performance wise. The potentially expensive modulo could be avoided entirely with an if statement. Or, only use powers of 2 for the capacity, and then you can also use bit wise ops
It could be improved even more, performance wise. The potentially expensive modulo could be avoided entirely with an if statement. Or, only use powers of 2 for the capacity, and then you can also use bit wise ops