dict.c: fix dictGenericDelete() return ASAP condition.

Recently we moved the "return ASAP" condition for the Delete() function
from checking .size to checking .used, which is smarter, however while
testing the first table alone always works to ensure the dict is totally
emtpy, when we test the .size field, testing .used requires testing both
T0 and T1, since a rehashing could be in progress.
This commit is contained in:
antirez 2016-09-20 17:22:30 +02:00
parent de5aa838dd
commit cc88e14c87

View File

@ -415,7 +415,8 @@ static dictEntry *dictGenericDelete(dict *d, const void *key, int nofree) {
dictEntry *he, *prevHe;
int table;
if (d->ht[0].used == 0) return NULL;
if (d->ht[0].used == 0 && d->ht[1].used == 0) return NULL;
if (dictIsRehashing(d)) _dictRehashStep(d);
h = dictHashKey(d, key);