mirror of https://mirror.osredm.com/root/redis.git
Use precomptued objects for bulk and mbulk prefixes.
This commit is contained in:
parent
c06de115af
commit
7398930756
|
@ -474,6 +474,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,'*');
|
||||
}
|
||||
|
||||
|
@ -496,6 +499,10 @@ void addReplyBulkLen(redisClient *c, robj *obj) {
|
|||
len++;
|
||||
}
|
||||
}
|
||||
|
||||
if (len < REDIS_SHARED_BULKHDR_LEN)
|
||||
addReply(c,shared.bulkhdr[len]);
|
||||
else
|
||||
addReplyLongLongWithPrefix(c,len,'$');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue