From: Pieter Noordhuis Date: Wed, 9 Mar 2011 15:13:39 +0000 (+0100) Subject: Fix used function in ZCARD X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/cc4c964b33ac108c9541e31eb2e2420addf9a82e Fix used function in ZCARD --- diff --git a/src/t_zset.c b/src/t_zset.c index 35d95ba7..3c9ede1c 100644 --- a/src/t_zset.c +++ b/src/t_zset.c @@ -451,6 +451,7 @@ int zzlCompareElements(unsigned char *eptr, unsigned char *cstr, unsigned int cl unsigned int zzlLength(robj *zobj) { unsigned char *zl = zobj->ptr; + redisAssert(zobj->encoding == REDIS_ENCODING_ZIPLIST); return ziplistLen(zl)/2; } @@ -1602,7 +1603,7 @@ void zcardCommand(redisClient *c) { if ((zobj = lookupKeyReadOrReply(c,key,shared.czero)) == NULL || checkType(c,zobj,REDIS_ZSET)) return; - addReplyLongLong(c,zzlLength(zobj)); + addReplyLongLong(c,zsLength(zobj)); } void zscoreCommand(redisClient *c) {