diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2011-03-09 16:13:39 +0100 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2011-03-09 16:13:39 +0100 |
commit | cc4c964b33ac108c9541e31eb2e2420addf9a82e (patch) | |
tree | 1e1c9bf536f0f958370cccd4fdc14eb72e1aea3b /src/t_zset.c | |
parent | a669d5e99945b873279eadfcf289181956cb62c3 (diff) | |
download | redis-cc4c964b33ac108c9541e31eb2e2420addf9a82e.tar.gz |
Fix used function in ZCARD
Diffstat (limited to 'src/t_zset.c')
-rw-r--r-- | src/t_zset.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/t_zset.c b/src/t_zset.c index 35d95ba75..3c9ede1c0 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) { |