Simplify filter predicate

Untangle a double negative to make this line shorter and easier to read.

// FREEBIE
This commit is contained in:
lilia 2015-10-01 20:59:22 -07:00
parent 0fa1069a93
commit 9872b59355
2 changed files with 2 additions and 2 deletions

View file

@ -38249,7 +38249,7 @@ axolotlInternal.RecipientRecord = function() {
if (group === undefined)
throw new Error("Tried to update numbers for unknown group");
if (numbers.filter(function(number) { return !textsecure.utils.isNumberSane(number); }).length > 0)
if (numbers.filter(textsecure.utils.isNumberSane).length < numbers.length)
throw new Error("Invalid number in new group members");
if (group.numbers.filter(function(number) { return numbers.indexOf(number) < 0 }).length > 0)

View file

@ -136,7 +136,7 @@
if (group === undefined)
throw new Error("Tried to update numbers for unknown group");
if (numbers.filter(function(number) { return !textsecure.utils.isNumberSane(number); }).length > 0)
if (numbers.filter(textsecure.utils.isNumberSane).length < numbers.length)
throw new Error("Invalid number in new group members");
if (group.numbers.filter(function(number) { return numbers.indexOf(number) < 0 }).length > 0)