MCPcopy Index your code
hub / github.com/caike/jQuery-Simple-Timer / createCache

Function createCache

examples/bundle.js:1172–1184  ·  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

1170 * deleting the oldest entry
1171 */
1172function createCache() {
1173 var keys = [];
1174
1175 function cache( key, value ) {
1176 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
1177 if ( keys.push( key + " " ) > Expr.cacheLength ) {
1178 // Only keep the most recent entries
1179 delete cache[ keys.shift() ];
1180 }
1181 return (cache[ key + " " ] = value);
1182 }
1183 return cache;
1184}
1185
1186/**
1187 * Mark a function for special use by Sizzle

Callers 1

bundle.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected