mirror of
https://github.com/fluencelabs/redis
synced 2025-04-16 22:22:13 +00:00
parent
170e41464d
commit
777020839a
@ -211,6 +211,9 @@ int dictExpand(dict *d, unsigned long size)
|
|||||||
if (dictIsRehashing(d) || d->ht[0].used > size)
|
if (dictIsRehashing(d) || d->ht[0].used > size)
|
||||||
return DICT_ERR;
|
return DICT_ERR;
|
||||||
|
|
||||||
|
/* Rehashing to the same table size is not useful. */
|
||||||
|
if (realsize == d->ht[0].size) return DICT_ERR;
|
||||||
|
|
||||||
/* Allocate the new hash table and initialize all pointers to NULL */
|
/* Allocate the new hash table and initialize all pointers to NULL */
|
||||||
n.size = realsize;
|
n.size = realsize;
|
||||||
n.sizemask = realsize-1;
|
n.sizemask = realsize-1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user