* 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
()
| 846 | * deleting the oldest entry |
| 847 | */ |
| 848 | function 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…