* Promotes the node to the end of the linked list. * It means that the node is most frequently used. * It also reduces the chance for such node to get evicted from cache. * @param {LinkedListNode} node
(node)
| 78 | * @param {LinkedListNode} node |
| 79 | */ |
| 80 | promote(node) { |
| 81 | this.evict(node); |
| 82 | this.append(node); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Appends a new node to the end of the cache linked list. |