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

Function createCache

src/selector/createCache.js:9–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7 * deleting the oldest entry
8 */
9export function createCache() {
10 var keys = [];
11
12 function cache( key, value ) {
13
14 // Use (key + " ") to avoid collision with native prototype properties
15 // (see https://github.com/jquery/sizzle/issues/157)
16 if ( keys.push( key + " " ) > jQuery.expr.cacheLength ) {
17
18 // Only keep the most recent entries
19 delete cache[ keys.shift() ];
20 }
21 return ( cache[ key + " " ] = value );
22 }
23 return cache;
24}

Callers 2

selector.jsFile · 0.90
tokenize.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected