mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
addReplyLongLong optimized to return shared objects when the value to reply is 0 or 1
This commit is contained in:
@@ -321,7 +321,12 @@ void _addReplyLongLong(redisClient *c, long long ll, char prefix) {
|
||||
}
|
||||
|
||||
void addReplyLongLong(redisClient *c, long long ll) {
|
||||
_addReplyLongLong(c,ll,':');
|
||||
if (ll == 0)
|
||||
addReply(c,shared.czero);
|
||||
else if (ll == 1)
|
||||
addReply(c,shared.cone);
|
||||
else
|
||||
_addReplyLongLong(c,ll,':');
|
||||
}
|
||||
|
||||
void addReplyMultiBulkLen(redisClient *c, long length) {
|
||||
|
||||
Reference in New Issue
Block a user