diff --git a/src/hashtable.c b/src/hashtable.c index 23097eb246..6b503b637c 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -1518,7 +1518,6 @@ void hashtableTwoPhasePopDelete(hashtable *ht, hashtablePosition *pos) { assert(isPositionFilled(b, pos_in_bucket)); b->presence &= ~(1 << pos_in_bucket); ht->used[table_index]--; - hashtableShrinkIfNeeded(ht); hashtableResumeRehashing(ht); if (b->chained && !hashtableIsRehashingPaused(ht)) { /* Rehashing paused also means bucket chain compaction paused. It is @@ -1527,6 +1526,7 @@ void hashtableTwoPhasePopDelete(hashtable *ht, hashtablePosition *pos) { * we do the compaction in the scan and iterator code instead. */ fillBucketHole(ht, b, pos_in_bucket, table_index); } + hashtableShrinkIfNeeded(ht); } /* Initializes the state for an incremental find operation.