From 230f90173cd7ca6dbfc2000d8ac04086aadcdfc7 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 8 Jul 2015 10:42:44 -0700 Subject: [PATCH] Use strict equality checks for `baseIndexOf` comparisons. --- lodash.src.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index d8912cd7c..97b8f928a 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -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); }