* Removes a node from its current position in the doubly-linked list. * Updates the prev/next pointers of adjacent nodes to maintain list integrity. * PRECONDITION: node must be connected (prev/next are non-null)
(node: LRUNode<T>)
| 88 | * PRECONDITION: node must be connected (prev/next are non-null) |
| 89 | */ |
| 90 | private removeNode(node: LRUNode<T>): void { |
| 91 | // Connected nodes always have non-null prev/next |
| 92 | node.prev!.next = node.next |
| 93 | node.next!.prev = node.prev |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Moves an existing node to the head position (marks as most recently used). |
no outgoing calls
no test coverage detected