Simplify _.every and _.some.

This commit is contained in:
John-David Dalton
2014-02-06 09:06:35 -08:00
parent 23b495aee8
commit 8a2e06a713
7 changed files with 33 additions and 33 deletions

View File

@@ -2159,8 +2159,8 @@
if (typeof length == 'number') {
while (++index < length) {
if (!(result = !!callback(collection[index], index, collection))) {
break;
if (!callback(collection[index], index, collection)) {
return false;
}
}
} else {
@@ -2989,8 +2989,8 @@
if (typeof length == 'number') {
while (++index < length) {
if ((result = callback(collection[index], index, collection))) {
break;
if (callback(collection[index], index, collection)) {
return true;
}
}
} else {