NewLRU represent initiate lru cache with capacity
(capacity int)
| 28 | |
| 29 | // NewLRU represent initiate lru cache with capacity |
| 30 | func NewLRU(capacity int) LRU { |
| 31 | return LRU{ |
| 32 | dl: linkedlist.NewDoubly[any](), |
| 33 | storage: make(map[string]*linkedlist.Node[any], capacity), |
| 34 | size: 0, |
| 35 | capacity: capacity, |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | // Get value from lru |
| 40 | // if not found, return nil |
nothing calls this directly
no outgoing calls
no test coverage detected