-1 not needed...

This commit is contained in:
antirez 2010-04-08 16:07:18 +02:00
parent 6fcb180039
commit 10c2baa50a

View File

@ -5092,7 +5092,7 @@ static int zslRandomLevel(void) {
int level = 1; int level = 1;
while ((random()&0xFFFF) < (ZSKIPLIST_P * 0xFFFF)) while ((random()&0xFFFF) < (ZSKIPLIST_P * 0xFFFF))
level += 1; level += 1;
return (level<ZSKIPLIST_MAXLEVEL) ? level : (ZSKIPLIST_MAXLEVEL-1); return (level<ZSKIPLIST_MAXLEVEL) ? level : ZSKIPLIST_MAXLEVEL;
} }
static void zslInsert(zskiplist *zsl, double score, robj *obj) { static void zslInsert(zskiplist *zsl, double score, robj *obj) {