a zip code crypto-currency system good for red ONLY

_listCacheDelete.js 775B

123456789101112131415161718192021222324252627282930313233343536
  1. var assocIndexOf = require('./_assocIndexOf');
  2. /** Used for built-in method references. */
  3. var arrayProto = Array.prototype;
  4. /** Built-in value references. */
  5. var splice = arrayProto.splice;
  6. /**
  7. * Removes `key` and its value from the list cache.
  8. *
  9. * @private
  10. * @name delete
  11. * @memberOf ListCache
  12. * @param {string} key The key of the value to remove.
  13. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14. */
  15. function listCacheDelete(key) {
  16. var data = this.__data__,
  17. index = assocIndexOf(data, key);
  18. if (index < 0) {
  19. return false;
  20. }
  21. var lastIndex = data.length - 1;
  22. if (index == lastIndex) {
  23. data.pop();
  24. } else {
  25. splice.call(data, index, 1);
  26. }
  27. --this.size;
  28. return true;
  29. }
  30. module.exports = listCacheDelete;