From 9ad227dca87d4606bfe2b778db8a3bbcfa144e38 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 14 May 2020 11:17:47 +0200 Subject: [PATCH] rax.c updated from upstream antirez/rax. --- src/rax.c | 6 ++++-- 1 file 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 + * Version 1.2 -- 7 February 2019 + * + * Copyright (c) 2017-2019, Salvatore Sanfilippo * 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; }