sm
/
cache
1
0
Fork 0
This commit is contained in:
Dolf Schimmel 2017-03-29 08:08:39 +00:00 committed by GitHub
commit f2390a1370
1 changed files with 11 additions and 0 deletions

View File

@ -135,6 +135,17 @@ func (c *cache) Get(k string) (interface{}, bool) {
return item.Object, true
}
func (c *cache) GetPossiblyExpired(k string) (interface{}, bool) {
c.mu.RLock()
// "Inlining" of get and Expired
item, found := c.items[k]
c.mu.RUnlock()
if !found {
return nil, false
}
return item.Object, true
}
func (c *cache) get(k string) (interface{}, bool) {
item, found := c.items[k]
if !found {