Skip to content

Commit 4645711

Browse files
committed
enumerable.js#all improved performance by removing AND operation
1 parent e3d5200 commit 4645711

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/prototype/lang/enumerable.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,10 @@ var Enumerable = (function() {
218218
iterator = iterator || Prototype.K;
219219
var result = true;
220220
this.each(function(value, index) {
221-
result = result && !!iterator.call(context, value, index, this);
222-
if (!result) throw $break;
221+
if (!iterator.call(context, value, index, this)) {
222+
result = false;
223+
throw $break;
224+
}
223225
}, this);
224226
return result;
225227
}

0 commit comments

Comments
 (0)