dont need to call multi if keys.length is 0

This commit is contained in:
Barış Soner Uşaklı
2018-11-21 17:24:38 -05:00
parent 20abc7fc47
commit 48690a01b9
2 changed files with 4 additions and 1 deletions

View File

@@ -172,6 +172,9 @@ module.exports = function (redisClient, module) {
};
module.getSortedSetsMembers = function (keys, callback) {
if (!Array.isArray(keys) || !keys.length) {
return setImmediate(callback, null, []);
}
var multi = redisClient.multi();
for (var i = 0; i < keys.length; i += 1) {
multi.zrange(keys[i], 0, -1);