Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yujieli-temporal committed Aug 2, 2023
1 parent 3ddbfb2 commit 63c654d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions common/cache/lru.go
Expand Up @@ -337,12 +337,14 @@ func (c *lru) tryEvictUntilEnoughSpace(newEntrySize int) {
for c.currSize+newEntrySize > c.maxSize && element != nil {
entry := element.Value.(*entryImpl)
if entry.refCount == 0 {
elementPrev := element.Prev()
c.deleteInternal(element)
element = elementPrev
} else {
// entry.refCount > 0
// skip, entry still being referenced
element = element.Prev()
}

// entry.refCount > 0
// skip, entry still being referenced
element = element.Prev()
}
}

Expand Down

0 comments on commit 63c654d

Please sign in to comment.