blob: 6fd915bdc181a7553d1531b0a2a7bee98fa1fa79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
var MapCache = require('./_MapCache'),
cachePush = require('./_cachePush');
/**
*
* Creates a set cache object to store unique values.
*
* @private
* @constructor
* @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 methods to `SetCache`.
SetCache.prototype.push = cachePush;
module.exports = SetCache;
|