remove unnecessary checks

This commit is contained in:
Barış Soner Uşaklı
2017-05-27 00:30:07 -04:00
parent 6a742ead38
commit f1b8492164
12 changed files with 29 additions and 40 deletions

View File

@@ -235,10 +235,6 @@ Notifications.pushGroup = function (notification, groupName, callback) {
groups.getMembers(groupName, 0, -1, next);
},
function (members, next) {
if (!Array.isArray(members) || !members.length) {
return callback();
}
Notifications.push(notification, members, next);
},
], callback);
@@ -387,7 +383,7 @@ Notifications.prune = function (callback) {
db.getSortedSetRangeByScore('notifications', 0, 500, '-inf', cutoffTime, next);
},
function (nids, next) {
if (!Array.isArray(nids) || !nids.length) {
if (!nids.length) {
return callback();
}