summaryrefslogtreecommitdiff
path: root/src/rax.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2020-05-14 11:17:47 +0200
committerantirez <antirez@gmail.com>2020-05-14 11:17:47 +0200
commit3e6acc24d6e00c7ca14e02bf7e81a8650f48f63a (patch)
tree1b59f864b9673b00486171059b549ab20804d211 /src/rax.c
parenta4d0720fa105b5bc8bd4a5607864862185b78105 (diff)
downloadredis-3e6acc24d6e00c7ca14e02bf7e81a8650f48f63a.tar.gz
rax.c updated from upstream antirez/rax.
Diffstat (limited to 'src/rax.c')
-rw-r--r--src/rax.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rax.c b/src/rax.c
index a560dde02..7dcf04582 100644
--- a/src/rax.c
+++ b/src/rax.c
@@ -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;
}