Commit 009db676 authored by antirez's avatar antirez
Browse files

addReplyLongLong optimized to return shared objects when the value to reply is 0 or 1

parent 2e667806
...@@ -321,7 +321,12 @@ void _addReplyLongLong(redisClient *c, long long ll, char prefix) { ...@@ -321,7 +321,12 @@ void _addReplyLongLong(redisClient *c, long long ll, char prefix) {
} }
void addReplyLongLong(redisClient *c, long long ll) { 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) { void addReplyMultiBulkLen(redisClient *c, long length) {
......
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