MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified. The element must not be nil.
(e *Entry[K, V])
| 486 | // If e is not an element of l, the list is not modified. |
| 487 | // The element must not be nil. |
| 488 | func (l *LruList[K, V]) MoveToFront(e *Entry[K, V]) { |
| 489 | if e.list != l || l.root.next == e { |
| 490 | return |
| 491 | } |
| 492 | // see comment in List.Remove about initialization of l |
| 493 | l.move(e, &l.root) |
| 494 | } |