+ addReply(c,shared.nullbulk);
+ }
+ } else if (zobj->encoding == REDIS_ENCODING_RAW) {
+ zset *zs = zobj->ptr;
+ zskiplist *zsl = zs->zsl;
+ dictEntry *de;
+ double score;
+
+ ele = c->argv[2] = tryObjectEncoding(c->argv[2]);
+ de = dictFind(zs->dict,ele);
+ if (de != NULL) {
+ score = *(double*)dictGetEntryVal(de);
+ rank = zslGetRank(zsl,score,ele);
+ redisAssert(rank); /* Existing elements always have a rank. */
+ if (reverse)
+ addReplyLongLong(c,llen-rank);
+ else
+ addReplyLongLong(c,rank-1);
+ } else {
+ addReply(c,shared.nullbulk);