]> git.saurik.com Git - redis.git/blobdiff - src/sort.c
call lua_gc() for incremental garbage collection. Likely there is to tune this at...
[redis.git] / src / sort.c
index 1cf8932e3758c14d756d92dd0da5241b1ca49e05..ff275c958a22684ff7fbb1f92c1ce62ad3ca88f0 100644 (file)
@@ -199,6 +199,9 @@ void sortCommand(redisClient *c) {
         j++;
     }
 
+    /* Destructively convert encoded sorted sets for SORT. */
+    if (sortval->type == REDIS_ZSET) zsetConvert(sortval, REDIS_ENCODING_SKIPLIST);
+
     /* Load the sorting vector with all the objects to sort */
     switch(sortval->type) {
     case REDIS_LIST: vectorlen = listTypeLength(sortval); break;