]> git.saurik.com Git - redis.git/blobdiff - src/sort.c
Optimize LRANGE to scan the list starting from the head or the tail in order to trave...
[redis.git] / src / sort.c
index ff275c958a22684ff7fbb1f92c1ce62ad3ca88f0..e4fe130c0dc778e115f01c41bfc355d26329faf5 100644 (file)
@@ -366,12 +366,12 @@ void sortCommand(redisClient *c) {
                 }
             }
         }
-        dbReplace(c->db,storekey,sobj);
+        setKey(c->db,storekey,sobj);
+        decrRefCount(sobj);
         /* Note: we add 1 because the DB is dirty anyway since even if the
          * SORT result is empty a new key is set and maybe the old content
          * replaced. */
         server.dirty += 1+outputlen;
-        signalModifiedKey(c->db,storekey);
         addReplyLongLong(c,outputlen);
     }