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

Function createCache

2.0.3/2.0.3.js:1168–1180  ·  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

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

Callers 1

2.0.3.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected