Cleanup mapClear.

This commit is contained in:
John-David Dalton
2015-12-17 20:43:32 -08:00
parent 380435d020
commit b1d396bbbb
2 changed files with 22 additions and 35 deletions

View File

@@ -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 };
}
/*------------------------------------------------------------------------*/
/**