Use specialized function to add multi bulk reply length

This commit is contained in:
Pieter Noordhuis
2010-09-02 12:38:34 +02:00
parent 57b0738011
commit 0537e7bf80
9 changed files with 14 additions and 10 deletions

View File

@ -782,8 +782,7 @@ void zrangeGenericCommand(redisClient *c, int reverse) {
}
/* Return the result in form of a multi-bulk reply */
addReplySds(c,sdscatprintf(sdsempty(),"*%d\r\n",
withscores ? (rangelen*2) : rangelen));
addReplyMultiBulkLen(c,withscores ? (rangelen*2) : rangelen);
for (j = 0; j < rangelen; j++) {
ele = ln->obj;
addReplyBulk(c,ele);