diff options
author | antirez <antirez@gmail.com> | 2019-02-19 17:27:42 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2019-02-19 17:27:42 +0100 |
commit | 25b392f90c3436d8db44111194070d6e3eeea5cc (patch) | |
tree | ae82955699bc419cdf2c24be9f3c806ddc34eb95 /src/dict.c | |
parent | f284e37f24629bad61530f02937a2b13fedd6283 (diff) | |
download | redis-25b392f90c3436d8db44111194070d6e3eeea5cc.tar.gz |
Set dictGetFairRandomKey() samples to 20 for final version.
Distribution improves dramatically: tests show it clearly. Better to
have a slower implementation than a wrong one, because random member
extraction should be correct or tends to be useless for a number of
tasks.
Diffstat (limited to 'src/dict.c')
-rw-r--r-- | src/dict.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dict.c b/src/dict.c index ce48eb419..106467ef7 100644 --- a/src/dict.c +++ b/src/dict.c @@ -750,7 +750,7 @@ unsigned int dictGetSomeKeys(dict *d, dictEntry **des, unsigned int count) { * that may be constituted of N buckets with chains of different lengths * appearing one after the other. Then we report a random element in the range. * In this way we smooth away the problem of different chain lenghts. */ -#define GETFAIR_NUM_ENTRIES 10 +#define GETFAIR_NUM_ENTRIES 15 dictEntry *dictGetFairRandomKey(dict *d) { dictEntry *entries[GETFAIR_NUM_ENTRIES]; unsigned int count = dictGetSomeKeys(d,entries,GETFAIR_NUM_ENTRIES); |