MCPcopy Index your code
hub / github.com/JsAaron/jQuery / createCache

Function createCache

2.1.1/test/sizzle.js:314–326  ·  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

312 * deleting the oldest entry
313 */
314function createCache() {
315 var keys = [];
316
317 function cache( key, value ) {
318 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
319 if ( keys.push( key + " " ) > Expr.cacheLength ) {
320 // Only keep the most recent entries
321 delete cache[ keys.shift() ];
322 }
323 return (cache[ key + " " ] = value);
324 }
325 return cache;
326}
327
328/**
329 * Mark a function for special use by Sizzle

Callers 1

sizzle.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected