MCPcopy Create free account
hub / github.com/dtmilano/AndroidViewClient / createCache

Function createCache

docs/_static/jquery-3.6.0.js:907–921  ·  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

905 * deleting the oldest entry
906 */
907function createCache() {
908 var keys = [];
909
910 function cache( key, value ) {
911
912 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
913 if ( keys.push( key + " " ) > Expr.cacheLength ) {
914
915 // Only keep the most recent entries
916 delete cache[ keys.shift() ];
917 }
918 return ( cache[ key + " " ] = value );
919 }
920 return cache;
921}
922
923/**
924 * Mark a function for special use by Sizzle

Callers 1

jquery-3.6.0.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected