mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Optimize _.uniq and others in Firefox.
This commit is contained in:
@@ -1963,7 +1963,7 @@
|
|||||||
var index = -1,
|
var index = -1,
|
||||||
indexOf = getIndexOf(),
|
indexOf = getIndexOf(),
|
||||||
isCommon = indexOf == baseIndexOf,
|
isCommon = indexOf == baseIndexOf,
|
||||||
cache = isCommon && values.length >= 200 && createCache(values),
|
cache = (isCommon && values.length >= 200) ? createCache(values) : null,
|
||||||
valuesLength = values.length;
|
valuesLength = values.length;
|
||||||
|
|
||||||
if (cache) {
|
if (cache) {
|
||||||
@@ -2783,7 +2783,7 @@
|
|||||||
length = array.length,
|
length = array.length,
|
||||||
isCommon = indexOf == baseIndexOf,
|
isCommon = indexOf == baseIndexOf,
|
||||||
isLarge = isCommon && length >= 200,
|
isLarge = isCommon && length >= 200,
|
||||||
seen = isLarge && createCache(),
|
seen = isLarge ? createCache() : null,
|
||||||
result = [];
|
result = [];
|
||||||
|
|
||||||
if (seen) {
|
if (seen) {
|
||||||
@@ -4772,7 +4772,7 @@
|
|||||||
var value = arguments[argsIndex];
|
var value = arguments[argsIndex];
|
||||||
if (isArray(value) || isArguments(value)) {
|
if (isArray(value) || isArguments(value)) {
|
||||||
args.push(value);
|
args.push(value);
|
||||||
caches.push(isCommon && value.length >= 120 && createCache(argsIndex && value));
|
caches.push((isCommon && value.length >= 120) ? createCache(argsIndex && value) : null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
argsLength = args.length;
|
argsLength = args.length;
|
||||||
|
|||||||
Reference in New Issue
Block a user