Bump to v4.12.0.

This commit is contained in:
John-David Dalton
2016-05-07 12:00:39 -07:00
parent ddde027fd9
commit dbe6a9008c
127 changed files with 1258 additions and 1116 deletions

View File

@@ -1,5 +1,5 @@
var MapCache = require('./_MapCache'),
assocSet = require('./_assocSet');
var ListCache = require('./_ListCache'),
MapCache = require('./_MapCache');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
@@ -15,21 +15,11 @@ var LARGE_ARRAY_SIZE = 200;
* @returns {Object} Returns the stack cache instance.
*/
function stackSet(key, value) {
var data = this.__data__,
array = data.array;
if (array) {
if (array.length < (LARGE_ARRAY_SIZE - 1)) {
assocSet(array, key, value);
} else {
data.array = null;
data.map = new MapCache(array);
}
}
var map = data.map;
if (map) {
map.set(key, value);
var cache = this.__data__;
if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) {
cache = this.__data__ = new MapCache(cache.__data__);
}
cache.set(key, value);
return this;
}