- dbReplace(c->db,storekey,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;
- touchWatchedKey(c->db,storekey);
+ if (outputlen) setKey(c->db,storekey,sobj);
+ decrRefCount(sobj);
+ server.dirty += outputlen;