From b3857adc0f49dac30e73a239b29739118e03e942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 26 Apr 2023 08:35:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/ttlcache/cache.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/internal/ttlcache/cache.go b/internal/ttlcache/cache.go index 73a3453..f6a0e71 100644 --- a/internal/ttlcache/cache.go +++ b/internal/ttlcache/cache.go @@ -14,8 +14,6 @@ var SharedCache = NewBigCache() // Piece1 | Piece2 | Piece3 | ... // [ Item1, Item2, ... ] | ... // -// KeyMap列表数据结构 -// { timestamp1 => [key1, key2, ...] }, ... type Cache struct { isDestroyed bool pieces []*Piece @@ -147,7 +145,7 @@ func (this *Cache) Count() (count int) { func (this *Cache) GC() { var index = this.gcPieceIndex - var maxPiecesPerGC = 4 + const maxPiecesPerGC = 4 for i := index; i < index+maxPiecesPerGC; i++ { if i >= int(this.countPieces) { break