Fix for skiplists backward link

This commit is contained in:
antirez 2009-10-26 16:43:56 +01:00
parent 325d1eb4a8
commit bb975144e4

View File

@ -3776,7 +3776,7 @@ static void zslInsert(zskiplist *zsl, double score, robj *obj) {
x->forward[i] = update[i]->forward[i]; x->forward[i] = update[i]->forward[i];
update[i]->forward[i] = x; update[i]->forward[i] = x;
} }
x->backward = (update[0] == zsl->header) ? NULL : update[i]; x->backward = (update[0] == zsl->header) ? NULL : update[0];
if (x->forward[0]) if (x->forward[0])
x->forward[0]->backward = x; x->forward[0]->backward = x;
else else