Math them all.

This commit is contained in:
Michał Lipiński
2017-04-04 22:38:50 +02:00
parent bbd59f800b
commit 2538a56577
11 changed files with 14 additions and 52 deletions

View File

@@ -4,9 +4,6 @@ import arrayIncludesWith from './arrayIncludesWith.js'
import arrayMap from './arrayMap.js'
import cacheHas from './cacheHas.js'
/* Built-in method references for those with the same name as other `lodash` methods. */
const nativeMin = Math.min
/**
* The base implementation of methods like `intersection` that accepts an
* array of arrays to inspect.
@@ -33,7 +30,7 @@ function baseIntersection(arrays, iteratee, comparator) {
if (othIndex && iteratee) {
array = arrayMap(array, (value) => iteratee(value))
}
maxLength = nativeMin(array.length, maxLength)
maxLength = Math.min(array.length, maxLength)
caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
? new SetCache(othIndex && array)
: undefined