Use strict equality checks for baseIndexOf comparisons.

This commit is contained in:
John-David Dalton
2015-07-08 10:42:44 -07:00
parent fbc7c28188
commit 230f90173c

View File

@@ -620,7 +620,7 @@
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The function invoked per iteration.
* @returns {Array} Returns the new duplicate-value-free array.
* @returns {Array} Returns the new duplicate free array.
*/
function sortedUniq(array, iteratee) {
var seen,
@@ -1925,7 +1925,7 @@
}
var index = -1,
indexOf = getIndexOf(),
isCommon = indexOf == baseIndexOf,
isCommon = indexOf === baseIndexOf,
cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
valuesLength = values.length;
@@ -2794,13 +2794,13 @@
* @private
* @param {Array} array The array to inspect.
* @param {Function} [iteratee] The function invoked per iteration.
* @returns {Array} Returns the new duplicate-value-free array.
* @returns {Array} Returns the new duplicate free array.
*/
function baseUniq(array, iteratee) {
var index = -1,
indexOf = getIndexOf(),
length = array.length,
isCommon = indexOf == baseIndexOf,
isCommon = indexOf === baseIndexOf,
isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
seen = isLarge ? createCache() : null,
result = [];
@@ -5159,7 +5159,7 @@
othIndex = othLength,
caches = Array(length),
indexOf = getIndexOf(),
isCommon = indexOf == baseIndexOf,
isCommon = indexOf === baseIndexOf,
result = [];
while (othIndex--) {
@@ -5776,7 +5776,7 @@
if (!(iteratee == null && callback === baseCallback)) {
iteratee = callback(iteratee, thisArg, 3);
}
return (isSorted && getIndexOf() == baseIndexOf)
return (isSorted && getIndexOf() === baseIndexOf)
? sortedUniq(array, iteratee)
: baseUniq(array, iteratee);
}