dictScan(): empty hash table requires special handling.

This commit is contained in:
antirez
2013-10-28 11:17:18 +01:00
parent 7f063b1c8c
commit 17785f40b5

View File

@ -754,6 +754,8 @@ unsigned long dictScan(dict *d,
unsigned long s0, s1; unsigned long s0, s1;
unsigned long m0, m1; unsigned long m0, m1;
if (dictSize(d) == 0) return 0;
if (!dictIsRehashing(d)) { if (!dictIsRehashing(d)) {
t0 = &(d->ht[0]); t0 = &(d->ht[0]);
m0 = t0->sizemask; m0 = t0->sizemask;