From d4603ba739968f9f9c3f1e612ef3574a556092d3 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 27 Mar 2023 22:04:07 -0600 Subject: fix wonky sentence --- lib/caching/arcache.go | 11 +++++------ 1 file 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: -- cgit v1.1-4-g5e80