mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
dict.c/dictRehash: check again to update
This commit is contained in:
parent
4f427bc298
commit
2385630d0d
@ -282,6 +282,13 @@ int dictRehash(dict *d, int n) {
|
|||||||
d->ht[0].table[d->rehashidx] = NULL;
|
d->ht[0].table[d->rehashidx] = NULL;
|
||||||
d->rehashidx++;
|
d->rehashidx++;
|
||||||
}
|
}
|
||||||
|
/* Check again if we already rehashed the whole table... */
|
||||||
|
if (d->ht[0].used == 0) {
|
||||||
|
zfree(d->ht[0].table);
|
||||||
|
d->ht[0] = d->ht[1];
|
||||||
|
_dictReset(&d->ht[1]);
|
||||||
|
d->rehashidx = -1;
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user