MCPcopy Index your code
hub / github.com/frank-lam/fullstack-tutorial / createCache

Function createCache

notes/docsify/unpkg/gotop/jquery-2.1.0.js:848–860  ·  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

846 * deleting the oldest entry
847 */
848function createCache() {
849 var keys = [];
850
851 function cache( key, value ) {
852 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
853 if ( keys.push( key + " " ) > Expr.cacheLength ) {
854 // Only keep the most recent entries
855 delete cache[ keys.shift() ];
856 }
857 return (cache[ key + " " ] = value);
858 }
859 return cache;
860}
861
862/**
863 * Mark a function for special use by Sizzle

Callers 1

jquery-2.1.0.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…