diff --git a/src/dict.cpp b/src/dict.cpp index 88ad116bb..41e1a05da 100644 --- a/src/dict.cpp +++ b/src/dict.cpp @@ -681,6 +681,7 @@ static dictEntry *dictGenericDelete(dict *d, const void *key, int nofree) { } } d->ht[table].used--; + _dictExpandIfNeeded(d); return he; } prevHe = he; @@ -689,7 +690,6 @@ static dictEntry *dictGenericDelete(dict *d, const void *key, int nofree) { if (!dictIsRehashing(d)) break; } - _dictExpandIfNeeded(d); return NULL; /* not found */ }