1234567891011121314151617181920212223242526272829303132333435 |
- var assocIndexOf = require('./_assocIndexOf');
- var arrayProto = Array.prototype;
- var splice = arrayProto.splice;
- 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;
- }
- module.exports = listCacheDelete;
|