summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redis.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/redis.c b/redis.c
index 7a183fa12..06389edb1 100644
--- a/redis.c
+++ b/redis.c
@@ -4334,8 +4334,7 @@ static void incrDecrCommand(redisClient *c, long long incr) {
if (getLongLongFromObjectOrReply(c,o,&value,NULL) != REDIS_OK) return;
value += incr;
- o = createObject(REDIS_STRING,sdscatprintf(sdsempty(),"%lld",value));
- o = tryObjectEncoding(o);
+ o = createStringObjectFromLongLong(value);
retval = dictAdd(c->db->dict,c->argv[1],o);
if (retval == DICT_ERR) {
dictReplace(c->db->dict,c->argv[1],o);