MCPcopy
hub / github.com/vercel/next.js / removeNode

Method removeNode

packages/next/src/server/lib/lru-cache.ts:90–94  ·  view source on GitHub ↗

* 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>)

Source from the content-addressed store, hash-verified

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).

Callers 3

moveToHeadMethod · 0.95
removeTailMethod · 0.95
removeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected