mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Fix used function in ZCARD
This commit is contained in:
parent
a669d5e999
commit
cc4c964b33
@ -451,6 +451,7 @@ int zzlCompareElements(unsigned char *eptr, unsigned char *cstr, unsigned int cl
|
|||||||
|
|
||||||
unsigned int zzlLength(robj *zobj) {
|
unsigned int zzlLength(robj *zobj) {
|
||||||
unsigned char *zl = zobj->ptr;
|
unsigned char *zl = zobj->ptr;
|
||||||
|
redisAssert(zobj->encoding == REDIS_ENCODING_ZIPLIST);
|
||||||
return ziplistLen(zl)/2;
|
return ziplistLen(zl)/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1602,7 +1603,7 @@ void zcardCommand(redisClient *c) {
|
|||||||
if ((zobj = lookupKeyReadOrReply(c,key,shared.czero)) == NULL ||
|
if ((zobj = lookupKeyReadOrReply(c,key,shared.czero)) == NULL ||
|
||||||
checkType(c,zobj,REDIS_ZSET)) return;
|
checkType(c,zobj,REDIS_ZSET)) return;
|
||||||
|
|
||||||
addReplyLongLong(c,zzlLength(zobj));
|
addReplyLongLong(c,zsLength(zobj));
|
||||||
}
|
}
|
||||||
|
|
||||||
void zscoreCommand(redisClient *c) {
|
void zscoreCommand(redisClient *c) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user