newLRU creates a new cache with a least recently used eviction policy.
()
| 125 | |
| 126 | // newLRU creates a new cache with a least recently used eviction policy. |
| 127 | func newLRU() *lru { |
| 128 | return &lru{ |
| 129 | ll: list.New(), |
| 130 | m: make(map[cacheKey]*list.Element), |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | func (l *lru) addEntry(key cacheKey) { |
| 135 | e := l.ll.PushBack(key) |
no outgoing calls