MCPcopy Index your code
hub / github.com/hokein/electron-sample-apps / createCache

Function createCache

camera/jquery.js:852–864  ·  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

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

Callers 1

jquery.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected