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)
| 216 | // Add which the caller can use to reduce allocations by bundling the Entry |
| 217 | // structure with the key and value to be stored. |
| 218 | func (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. |
| 223 | func (bc *baseCache) MoveToEnd(entry *Entry) { |