Add optimizations for large arrays to _.difference, _.intersection, and _.without.

Former-commit-id: 26d55a6a3340e77b5269b2003d20def3fe77bca9
This commit is contained in:
John-David Dalton
2012-07-15 03:51:28 -04:00
parent e58d47a3b2
commit 8577816234
3 changed files with 311 additions and 12 deletions

View File

@@ -166,6 +166,25 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.difference');
(function() {
test('should work correctly when using `cachedContains`', function() {
var array1 = _.range(27),
array2 = array1.slice(),
a = {},
b = {},
c = {};
array1.push(a, b, c);
array2.push(b, c, a);
deepEqual(_.difference(array1, array2), []);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.escape');
(function() {