Files
lodash/_SetCache.js
John-David Dalton 466c67a8b6 Bump to v4.1.0.
2016-01-29 01:20:57 -08:00

25 lines
490 B
JavaScript

import MapCache from './_MapCache';
import cachePush from './_cachePush';
/**
*
* Creates a set cache object to store unique values.
*
* @private
* @param {Array} [values] The values to cache.
*/
function SetCache(values) {
var index = -1,
length = values ? values.length : 0;
this.__data__ = new MapCache;
while (++index < length) {
this.push(values[index]);
}
}
// Add functions to the `SetCache`.
SetCache.prototype.push = cachePush;
export default SetCache;