Simplify createCache.

This commit is contained in:
jdalton
2015-06-11 07:31:36 -07:00
parent 1a28ef3244
commit 419fb08266

View File

@@ -1901,7 +1901,7 @@
var index = -1,
indexOf = getIndexOf(),
isCommon = indexOf == baseIndexOf,
cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : undefined,
cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
valuesLength = values.length;
if (cache) {
@@ -2777,7 +2777,7 @@
length = array.length,
isCommon = indexOf == baseIndexOf,
isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
seen = isLarge ? createCache() : undefined,
seen = isLarge ? createCache() : null,
result = [];
if (seen) {
@@ -3223,9 +3223,9 @@
* @param {Array} [values] The values to cache.
* @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
*/
var createCache = !(nativeCreate && Set) ? constant(null) : function(values) {
return new SetCache(values);
};
function createCache(values) {
return (nativeCreate && Set) ? new SetCache(values) : null;
}
/**
* Creates a function that produces compound words out of the words in a
@@ -5114,7 +5114,7 @@
while (othIndex--) {
var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : undefined;
caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
}
var array = arrays[0],
index = -1,