mirror of
https://github.com/fluencelabs/redis
synced 2025-04-04 00:31:03 +00:00
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) {
|
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) {
|
|||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (len < REDIS_SHARED_BULKHDR_LEN)
|
||||||
|
addReply(c,shared.bulkhdr[len]);
|
||||||
|
else
|
||||||
addReplyLongLongWithPrefix(c,len,'$');
|
addReplyLongLongWithPrefix(c,len,'$');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user