4 ms·
I suggest improving the probing a little. Something like idx = (idx + 1) % map->cap; becomes iterCount++; idx = (idx + iterCount) % map->cap;
by TheDudeMan 2y ago
I suggest improving the probing a little. Something like
idx = (idx + 1) % map->cap;
becomes
iterCount++;
idx = (idx + iterCount) % map->cap;
- meisel 2y agoIt 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