Use ES6 Set to optimize for large arrays in _.uniq, _.difference, & _.intersection.

This commit is contained in:
John-David Dalton
2014-01-18 22:51:43 -08:00
parent 14099813f0
commit 55cbb12701
7 changed files with 238 additions and 514 deletions

View File

@@ -239,6 +239,7 @@
nativeKeys = isNative(nativeKeys = Object.keys) && nativeKeys,
nativeMax = Math.max,
nativeMin = Math.min,
nativeNow = isNative(nativeNow = Date.now) && nativeNow,
nativeRandom = Math.random;
/*--------------------------------------------------------------------------*/
@@ -4765,7 +4766,7 @@
* _.defer(function() { console.log(_.now() - stamp); });
* // => logs the number of milliseconds it took for the deferred function to be called
*/
var now = isNative(now = Date.now) && now || function() {
var now = nativeNow || function() {
return new Date().getTime();
};