Commit 73989307 authored by antirez's avatar antirez
Browse files

Use precomptued objects for bulk and mbulk prefixes.

parent c06de115
...@@ -474,6 +474,9 @@ void addReplyLongLong(redisClient *c, long long ll) { ...@@ -474,6 +474,9 @@ void addReplyLongLong(redisClient *c, long long ll) {
} }
void addReplyMultiBulkLen(redisClient *c, long length) { void addReplyMultiBulkLen(redisClient *c, long length) {
if (length < REDIS_SHARED_BULKHDR_LEN)
addReply(c,shared.mbulkhdr[length]);
else
addReplyLongLongWithPrefix(c,length,'*'); addReplyLongLongWithPrefix(c,length,'*');
} }
...@@ -496,6 +499,10 @@ void addReplyBulkLen(redisClient *c, robj *obj) { ...@@ -496,6 +499,10 @@ void addReplyBulkLen(redisClient *c, robj *obj) {
len++; len++;
} }
} }
if (len < REDIS_SHARED_BULKHDR_LEN)
addReply(c,shared.bulkhdr[len]);
else
addReplyLongLongWithPrefix(c,len,'$'); addReplyLongLongWithPrefix(c,len,'$');
} }
......
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