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

Method moveToHead

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

* Moves an existing node to the head position (marks as most recently used). * This is the core LRU operation - accessed items become most recent.

(node: LRUNode<T>)

Source from the content-addressed store, hash-verified

98 * This is the core LRU operation - accessed items become most recent.
99 */
100 private moveToHead(node: LRUNode<T>): void {
101 this.removeNode(node)
102 this.addToHead(node)
103 }
104
105 /**
106 * Removes and returns the least recently used node (the one before tail).

Callers 2

setMethod · 0.95
getMethod · 0.95

Calls 2

removeNodeMethod · 0.95
addToHeadMethod · 0.95

Tested by

no test coverage detected