Commit 94e543b5 authored by antirez's avatar antirez
Browse files

A fix for initialization of augmented skip lists

parent ddfaca9d
...@@ -4861,6 +4861,9 @@ static zskiplist *zslCreate(void) { ...@@ -4861,6 +4861,9 @@ 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;
/* span has space for ZSKIPLIST_MAXLEVEL-1 elements */
if (j < ZSKIPLIST_MAXLEVEL-1)
zsl->header->span[j] = 0; zsl->header->span[j] = 0;
} }
zsl->header->backward = NULL; zsl->header->backward = NULL;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment