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

Use precomptued objects for bulk and mbulk prefixes.

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