mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
Use strict equality checks for baseIndexOf comparisons.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user