* makes the `entry` the freshEnd of the LRU linked list
(entry)
| 7042 | * makes the `entry` the freshEnd of the LRU linked list |
| 7043 | */ |
| 7044 | function refresh(entry) { |
| 7045 | if (entry !== freshEnd) { |
| 7046 | if (!staleEnd) { |
| 7047 | staleEnd = entry; |
| 7048 | } else if (staleEnd === entry) { |
| 7049 | staleEnd = entry.n; |
| 7050 | } |
| 7051 | |
| 7052 | link(entry.n, entry.p); |
| 7053 | link(entry, freshEnd); |
| 7054 | freshEnd = entry; |
| 7055 | freshEnd.n = null; |
| 7056 | } |
| 7057 | } |
| 7058 | |
| 7059 | |
| 7060 | /** |