00001 var assocIndexOf = require('./_assocIndexOf'); 00002 00004 var arrayProto = Array.prototype; 00005 00007 var splice = arrayProto.splice; 00008 00018 function listCacheDelete(key) { 00019 var data = this.__data__, 00020 index = assocIndexOf(data, key); 00021 00022 if (index < 0) { 00023 return false; 00024 } 00025 var lastIndex = data.length - 1; 00026 if (index == lastIndex) { 00027 data.pop(); 00028 } else { 00029 splice.call(data, index, 1); 00030 } 00031 --this.size; 00032 return true; 00033 } 00034 00035 module.exports = listCacheDelete;