Created
March 2, 2010 17:05
-
-
Save pietern/319683 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* As backward only points to a non-header node, | |
* it would be possible to replace the ternary statement with | |
* simply "x->backwards", because the condition will always be false. | |
* | |
* ...right? | |
*/ | |
static void zslInsert(zskiplist *zsl, double score, robj *obj) { | |
... | |
x->backward = (update[0] == zsl->header) ? NULL : update[0]; | |
... | |
} | |
static int zslDelete(zskiplist *zsl, double score, robj *obj) { | |
.... | |
if (x->forward[0]) { | |
x->forward[0]->backward = (x->backward == zsl->header) ? | |
NULL : x->backward; | |
} else { | |
zsl->tail = x->backward; | |
} | |
.... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment