summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-27 22:04:07 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-27 22:04:07 -0600
commitd4603ba739968f9f9c3f1e612ef3574a556092d3 (patch)
tree67142f5ad0bd3edb8a8d77fe9b8237b76814ce0a
parent9a403a2102d018c6d6c7066b8d7e3118465580ee (diff)
fix wonky sentence
-rw-r--r--lib/caching/arcache.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/caching/arcache.go b/lib/caching/arcache.go
index 3f69a29..c5fe190 100644
--- a/lib/caching/arcache.go
+++ b/lib/caching/arcache.go
@@ -358,6 +358,7 @@ func (c *arCache[K, V]) dblReplace() *LinkedListEntry[arcLiveEntry[K, V]] {
delete(c.liveByName, entry.Value.key)
return entry
default: // case !c.recentPinned.IsEmpty(): // top
+
// This can't happen because `c.recentLen == c.cap &&
// c.recentGhost.IsEmpty() && c.recentLive.IsEmpty()`
// implies that `c.recentPinned.Len == c.cap`, which
@@ -379,12 +380,10 @@ func (c *arCache[K, V]) dblReplace() *LinkedListEntry[arcLiveEntry[K, V]] {
case !c.frequentGhost.IsEmpty():
return c.arcReplace(c.frequentGhost.Oldest, false)
default:
- // This can't happen because it's impossible
- // that `recentLen < c.cap` implies that
- // `c.recentGhost.Len < c.cap`, which means
- // that there is at least one ghost entry that
- // is available in c.unusedGhost or
- // c.frequentGhost.
+ // This can't happen because `recentLen < c.cap` implies
+ // that `c.recentGhost.Len < c.cap`, which means that
+ // there is at least one ghost entry that is available
+ // in c.unusedGhost or c.frequentGhost.
panic(fmt.Errorf("should not happen: lengths don't match up"))
}
default: // case recentLen > c.cap: