MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / AddEntryAfter

Method AddEntryAfter

pkg/util/cache/cache.go:218–220  ·  view source on GitHub ↗

AddEntryAfter adds a value to the cache, making sure that it is placed after the second entry in the eviction queue. It provides an alternative interface to Add which the caller can use to reduce allocations by bundling the Entry structure with the key and value to be stored.

(entry, after *Entry)

Source from the content-addressed store, hash-verified

216// Add which the caller can use to reduce allocations by bundling the Entry
217// structure with the key and value to be stored.
218func (bc *baseCache) AddEntryAfter(entry, after *Entry) {
219 bc.add(entry.Key, entry.Value, entry, after)
220}
221
222// MoveToEnd moves the entry to the end of the eviction queue.
223func (bc *baseCache) MoveToEnd(entry *Entry) {

Callers

nothing calls this directly

Calls 1

addMethod · 0.95

Tested by

no test coverage detected