Rename Cache.c.getEntriesFromCacheLocked

Follows the naming convention for the locking requirements
This commit is contained in:
Julio Lopez
2019-11-08 00:51:17 -08:00
committed by Jarek Kowalski
parent 467243f23c
commit c5cb83c2e3

View File

@@ -89,7 +89,7 @@ func (c *Cache) Readdir(ctx context.Context, d fs.Directory) (fs.Entries, error)
return d.Readdir(ctx)
}
func (c *Cache) getEntriesFromCache(id string) fs.Entries {
func (c *Cache) getEntriesFromCacheLocked(id string) fs.Entries {
if v, ok := c.data[id]; id != "" && ok {
if time.Now().Before(v.expireAfter) {
c.moveToHead(v)
@@ -118,7 +118,7 @@ func (c *Cache) getEntries(ctx context.Context, id string, expirationTime time.D
c.mu.Lock()
defer c.mu.Unlock()
if entries := c.getEntriesFromCache(id); entries != nil {
if entries := c.getEntriesFromCacheLocked(id); entries != nil {
return entries, nil
}