mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Cleanup mapClear.
This commit is contained in:
24
lodash.js
24
lodash.js
@@ -1859,13 +1859,24 @@
|
||||
var index = -1,
|
||||
length = values ? values.length : 0;
|
||||
|
||||
this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };
|
||||
this.clear();
|
||||
while (++index < length) {
|
||||
var entry = values[index];
|
||||
this.set(entry[0], entry[1]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all key-value entries from the map.
|
||||
*
|
||||
* @private
|
||||
* @name clear
|
||||
* @memberOf MapCache
|
||||
*/
|
||||
function mapClear() {
|
||||
this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes `key` and its value from the map.
|
||||
*
|
||||
@@ -1939,17 +1950,6 @@
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the map data
|
||||
*
|
||||
* @private
|
||||
* @name clear
|
||||
* @memberOf MapCache
|
||||
*/
|
||||
function mapClear() {
|
||||
this.__data__ = { 'hash': new Hash, 'map': Map ? new Map : [], 'string': new Hash };
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user