(key string)
| 434 | } |
| 435 | |
| 436 | func (c *cache) get(key string) (value ByteView, ok bool) { |
| 437 | c.mu.Lock() |
| 438 | defer c.mu.Unlock() |
| 439 | c.nget++ |
| 440 | if c.lru == nil { |
| 441 | return |
| 442 | } |
| 443 | vi, ok := c.lru.Get(key) |
| 444 | if !ok { |
| 445 | return |
| 446 | } |
| 447 | c.nhit++ |
| 448 | return vi.(ByteView), true |
| 449 | } |
| 450 | |
| 451 | func (c *cache) removeOldest() { |
| 452 | c.mu.Lock() |