mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 00:28:26 -05:00
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:
parent
e9d861ec69
commit
670586715a
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user