mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
changed implementation of any to short-circuit when result is truthy
This commit is contained in:
@@ -194,7 +194,7 @@
|
|||||||
if (obj == null) return result;
|
if (obj == null) return result;
|
||||||
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
|
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
|
||||||
each(obj, function(value, index, list) {
|
each(obj, function(value, index, list) {
|
||||||
if (result = result||iterator.call(context, value, index, list)) return breaker;
|
if (result || (result = iterator.call(context, value, index, list))) return breaker;
|
||||||
});
|
});
|
||||||
return !!result;
|
return !!result;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user