@antv/layout
Version:
graph layout algorithm
49 lines (40 loc) • 1.19 kB
JavaScript
import { __require as require_assocIndexOf } from './_assocIndexOf.js';
var _listCacheDelete;
var hasRequired_listCacheDelete;
function require_listCacheDelete () {
if (hasRequired_listCacheDelete) return _listCacheDelete;
hasRequired_listCacheDelete = 1;
var assocIndexOf = require_assocIndexOf();
/** Used for built-in method references. */
var arrayProto = Array.prototype;
/** Built-in value references. */
var splice = arrayProto.splice;
/**
* Removes `key` and its value from the list cache.
*
* @private
* @name delete
* @memberOf ListCache
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function listCacheDelete(key) {
var data = this.__data__,
index = assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
_listCacheDelete = listCacheDelete;
return _listCacheDelete;
}
export { require_listCacheDelete as __require };
//# sourceMappingURL=_listCacheDelete.js.map