Unexport lru.Cache.RemoveOldest

This commit is contained in:
Cody Soyland 2018-07-05 22:01:03 -05:00
parent ffae51549b
commit 91ce0d6c57

View file

@ -66,7 +66,7 @@ func (c *Cache) Add(key Key, value interface{}) {
ele := c.ll.PushFront(&entry{key, value})
c.cache[key] = ele
if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries {
c.RemoveOldest()
c.removeOldest()
}
}
@ -92,8 +92,8 @@ func (c *Cache) remove(key Key) {
}
}
// RemoveOldest removes the oldest item from the cache.
func (c *Cache) RemoveOldest() {
// removeOldest removes the oldest item from the cache.
func (c *Cache) removeOldest() {
if c.cache == nil {
return
}