- if ((long) calc_bucket(hctl, currElement->hashvalue) == old_bucket)
+ if (!(currElement->hashvalue & (hctl->low_mask + 1)))
{
*oldlink = currElement;
oldlink = &currElement->link;
Will this still work if new_bucket is not equal to hctl->low_mask + 1?
The above situation seems possible because we increment new_bucket every time expand_table is called, but we only update low_mask when new_bucket exceeds high_mask.
This change has successfully passed the tests on Github CI. According to [1], the code has decent test coverage, but I'm not certain if the specific case mentioned above is included in the tests.