mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 23:37:49 +00:00
Bump to v4.16.0.
This commit is contained in:
12
_stackSet.js
12
_stackSet.js
@@ -14,16 +14,18 @@ define(['./_ListCache', './_Map', './_MapCache'], function(ListCache, Map, MapCa
|
||||
* @returns {Object} Returns the stack cache instance.
|
||||
*/
|
||||
function stackSet(key, value) {
|
||||
var cache = this.__data__;
|
||||
if (cache instanceof ListCache) {
|
||||
var pairs = cache.__data__;
|
||||
var data = this.__data__;
|
||||
if (data instanceof ListCache) {
|
||||
var pairs = data.__data__;
|
||||
if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
||||
pairs.push([key, value]);
|
||||
this.size = ++data.size;
|
||||
return this;
|
||||
}
|
||||
cache = this.__data__ = new MapCache(pairs);
|
||||
data = this.__data__ = new MapCache(pairs);
|
||||
}
|
||||
cache.set(key, value);
|
||||
data.set(key, value);
|
||||
this.size = data.size;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user