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
94e543b5
Commit
94e543b5
authored
Mar 04, 2010
by
antirez
Browse files
A fix for initialization of augmented skip lists
parent
ddfaca9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
94e543b5
...
@@ -4861,7 +4861,10 @@ static zskiplist *zslCreate(void) {
...
@@ -4861,7 +4861,10 @@ static zskiplist *zslCreate(void) {
zsl
->
header
=
zslCreateNode
(
ZSKIPLIST_MAXLEVEL
,
0
,
NULL
);
zsl
->
header
=
zslCreateNode
(
ZSKIPLIST_MAXLEVEL
,
0
,
NULL
);
for
(
j
=
0
;
j
<
ZSKIPLIST_MAXLEVEL
;
j
++
)
{
for
(
j
=
0
;
j
<
ZSKIPLIST_MAXLEVEL
;
j
++
)
{
zsl
->
header
->
forward
[
j
]
=
NULL
;
zsl
->
header
->
forward
[
j
]
=
NULL
;
zsl->header->span[j] = 0;
/* span has space for ZSKIPLIST_MAXLEVEL-1 elements */
if
(
j
<
ZSKIPLIST_MAXLEVEL
-
1
)
zsl
->
header
->
span
[
j
]
=
0
;
}
}
zsl
->
header
->
backward
=
NULL
;
zsl
->
header
->
backward
=
NULL
;
zsl
->
tail
=
NULL
;
zsl
->
tail
=
NULL
;
...
...
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