mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Bump to v4.1.0.
This commit is contained in:
24
_SetCache.js
Normal file
24
_SetCache.js
Normal file
@@ -0,0 +1,24 @@
|
||||
define(['./_MapCache', './_cachePush'], function(MapCache, 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;
|
||||
|
||||
return SetCache;
|
||||
});
|
||||
Reference in New Issue
Block a user