 +    if (val->type == OBJ_ZSET) {
 +        zset *zs = val->ptr;
 +        dict *ht = zs->dict;
-+        if (dictSize(ht) <= step * 2) {
++        if (dictSize(ht) <= limit) {
 +            decrRefCount(val);
 +            it->val = NULL;
 +        } else {

         server.db[j].tagged_keys = zslCreate();
     }
     server.pubsub_channels = dictCreate(&keylistDictType,NULL);
@@ -2428,7 +2453,9 @@ int processCommand(client *c) {
     }
 
     /* Check if the user is authenticated */

+}
+
+static void
+lazyReleaseIteratorNext(lazyReleaseIterator *it, int step) {
+    robj *val = it->val;
+    serverAssert(val != NULL);
+
+    unsigned int limit = step * 2;
+    if (limit < 100) {
+        limit = 100;
+    }
+
+    if (val->type == OBJ_LIST) {
+        if (listTypeLength(val) <= limit) {
+            decrRefCount(val);
+            it->val = NULL;
+        } else {
