MCPcopy
hub / github.com/go-gorm/gorm / MoveToFront

Method MoveToFront

internal/lru/lru.go:488–494  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

486// If e is not an element of l, the list is not modified.
487// The element must not be nil.
488func (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}

Callers 2

AddMethod · 0.80
GetMethod · 0.80

Calls 1

moveMethod · 0.95

Tested by

no test coverage detected