mirror of
https://github.com/fluencelabs/redis
synced 2025-05-16 12:31:20 +00:00
Use precomptued objects for bulk and mbulk prefixes.
This commit is contained in:
parent
004f00bfa4
commit
14a1cba3e3
@ -461,7 +461,10 @@ void addReplyLongLong(redisClient *c, long long ll) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void addReplyMultiBulkLen(redisClient *c, long length) {
|
void addReplyMultiBulkLen(redisClient *c, long length) {
|
||||||
addReplyLongLongWithPrefix(c,length,'*');
|
if (length < REDIS_SHARED_BULKHDR_LEN)
|
||||||
|
addReply(c,shared.mbulkhdr[length]);
|
||||||
|
else
|
||||||
|
addReplyLongLongWithPrefix(c,length,'*');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the length prefix of a bulk reply, example: $2234 */
|
/* Create the length prefix of a bulk reply, example: $2234 */
|
||||||
@ -483,7 +486,11 @@ void addReplyBulkLen(redisClient *c, robj *obj) {
|
|||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
addReplyLongLongWithPrefix(c,len,'$');
|
|
||||||
|
if (len < REDIS_SHARED_BULKHDR_LEN)
|
||||||
|
addReply(c,shared.bulkhdr[len]);
|
||||||
|
else
|
||||||
|
addReplyLongLongWithPrefix(c,len,'$');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add a Redis Object as a bulk reply */
|
/* Add a Redis Object as a bulk reply */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user