SCAN: simplify keys list cleanup using listSetFreeMethod().

This commit is contained in:
antirez 2013-10-25 11:58:03 +02:00
parent 0471b90844
commit a25fe0b28d

View File

@ -408,11 +408,7 @@ void scanCommand(redisClient *c) {
}
cleanup:
while ((node = listFirst(keys)) != NULL) {
robj *kobj = listNodeValue(node);
decrRefCount(kobj);
listDelNode(keys, node);
}
listSetFreeMethod(keys,decrRefCountVoid);
listRelease(keys);
}