]> git.saurik.com Git - redis.git/commitdiff
-1 not needed...
authorantirez <antirez@gmail.com>
Thu, 8 Apr 2010 14:07:18 +0000 (16:07 +0200)
committerantirez <antirez@gmail.com>
Thu, 8 Apr 2010 14:07:18 +0000 (16:07 +0200)
redis.c

diff --git a/redis.c b/redis.c
index 00dc6ccca0e6984e24833cfb3d2a7989f9cae154..f3db24265bcbedf56edc6e68298b92dd611fe092 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -5092,7 +5092,7 @@ static int zslRandomLevel(void) {
     int level = 1;
     while ((random()&0xFFFF) < (ZSKIPLIST_P * 0xFFFF))
         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) {