MCPcopy Index your code
hub / github.com/perkeep/perkeep / createCache

Function createCache

app/publisher/jquery.js:878–890  ·  view source on GitHub ↗

* Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry

()

Source from the content-addressed store, hash-verified

876 * deleting the oldest entry
877 */
878function createCache() {
879 var keys = [];
880
881 function cache( key, value ) {
882 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
883 if ( keys.push( key + " " ) > Expr.cacheLength ) {
884 // Only keep the most recent entries
885 delete cache[ keys.shift() ];
886 }
887 return (cache[ key + " " ] = value);
888 }
889 return cache;
890}
891
892/**
893 * Mark a function for special use by Sizzle

Callers 1

jquery.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected