From 861aaf06c62a84e9c3ba952d9fa8d2d531ac3643 Mon Sep 17 00:00:00 2001 From: jdalton Date: Sat, 21 Feb 2015 01:13:34 -0800 Subject: [PATCH] Optimize `_.uniq` and others in Firefox. --- lodash.src.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 98bc632ef..b91e1237a 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -1963,7 +1963,7 @@ var index = -1, indexOf = getIndexOf(), isCommon = indexOf == baseIndexOf, - cache = isCommon && values.length >= 200 && createCache(values), + cache = (isCommon && values.length >= 200) ? createCache(values) : null, valuesLength = values.length; if (cache) { @@ -2783,7 +2783,7 @@ length = array.length, isCommon = indexOf == baseIndexOf, isLarge = isCommon && length >= 200, - seen = isLarge && createCache(), + seen = isLarge ? createCache() : null, result = []; if (seen) { @@ -4772,7 +4772,7 @@ var value = arguments[argsIndex]; if (isArray(value) || isArguments(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;