mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Improve perf of max and min common case with arrays.
This commit is contained in:
@@ -3316,7 +3316,7 @@
|
|||||||
}
|
}
|
||||||
iteratee = getCallback(iteratee, thisArg, 3);
|
iteratee = getCallback(iteratee, thisArg, 3);
|
||||||
if (iteratee.length == 1) {
|
if (iteratee.length == 1) {
|
||||||
collection = toIterable(collection);
|
collection = isArray(collection) ? collection : toIterable(collection);
|
||||||
var result = arrayExtremum(collection, iteratee, comparator, exValue);
|
var result = arrayExtremum(collection, iteratee, comparator, exValue);
|
||||||
if (!(collection.length && result === exValue)) {
|
if (!(collection.length && result === exValue)) {
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user