mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
addReplyLongLong optimized to return shared objects when the value to reply is 0 or 1
This commit is contained in:
parent
2e667806ed
commit
009db67645
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user