Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
69362958
Commit
69362958
authored
May 14, 2020
by
antirez
Browse files
rax.c updated from upstream antirez/rax.
parent
e3b5648d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rax.c
View file @
69362958
/* Rax -- A radix tree implementation.
/* 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.
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
...
@@ -1737,7 +1739,7 @@ int raxRandomWalk(raxIterator *it, size_t steps) {
...
@@ -1737,7 +1739,7 @@ int raxRandomWalk(raxIterator *it, size_t steps) {
}
}
if
(
steps
==
0
)
{
if
(
steps
==
0
)
{
size_t
fle
=
floor
(
log
(
it
->
rt
->
numele
));
size_t
fle
=
1
+
floor
(
log
(
it
->
rt
->
numele
));
fle
*=
2
;
fle
*=
2
;
steps
=
1
+
rand
()
%
fle
;
steps
=
1
+
rand
()
%
fle
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment