mirror of https://mirror.osredm.com/root/redis.git
rax.c updated from upstream antirez/rax.
This commit is contained in:
parent
a4d0720fa1
commit
3e6acc24d6
|
@ -1,6 +1,8 @@
|
|||
/* Rax -- A radix tree implementation.
|
||||
*
|
||||
* Copyright (c) 2017-2018, Salvatore Sanfilippo <antirez at gmail dot com>
|
||||
* Version 1.2 -- 7 February 2019
|
||||
*
|
||||
* Copyright (c) 2017-2019, Salvatore Sanfilippo <antirez at gmail dot com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1737,7 +1739,7 @@ int raxRandomWalk(raxIterator *it, size_t steps) {
|
|||
}
|
||||
|
||||
if (steps == 0) {
|
||||
size_t fle = floor(log(it->rt->numele));
|
||||
size_t fle = 1+floor(log(it->rt->numele));
|
||||
fle *= 2;
|
||||
steps = 1 + rand() % fle;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue