Commit 14a1cba3 authored by antirez's avatar antirez
Browse files

Use precomptued objects for bulk and mbulk prefixes.

parent 004f00bf
...@@ -461,7 +461,10 @@ void addReplyLongLong(redisClient *c, long long ll) { ...@@ -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) { ...@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment