77 "github.com/scalalang2/golang-fifo"
88)
99
10- type s3fifoEntry [V any ] struct {
10+ type entry [V any ] struct {
1111 value V
1212 freq byte
1313}
@@ -19,7 +19,7 @@ type S3FIFO[K comparable, V any] struct {
1919 size int
2020
2121 // followings are the fundamental data structures of S3FIFO algorithm.
22- items map [K ]* s3fifoEntry [V ]
22+ items map [K ]* entry [V ]
2323 small * ringBuf [K ]
2424 main * ringBuf [K ]
2525 ghost * bucketTable [K ]
@@ -28,7 +28,7 @@ type S3FIFO[K comparable, V any] struct {
2828func New [K comparable , V any ](size int ) fifo.Cache [K , V ] {
2929 return & S3FIFO [K , V ]{
3030 size : size ,
31- items : make (map [K ]* s3fifoEntry [V ]),
31+ items : make (map [K ]* entry [V ]),
3232 small : newRingBuf [K ](size ),
3333 main : newRingBuf [K ](size ),
3434 ghost : newBucketTable [K ](size ),
@@ -60,7 +60,7 @@ func (s *S3FIFO[K, V]) Set(key K, value V) {
6060 }
6161 }
6262
63- ent := & s3fifoEntry [V ]{value : value , freq : 0 }
63+ ent := & entry [V ]{value : value , freq : 0 }
6464 s .items [key ] = ent
6565}
6666
@@ -106,7 +106,7 @@ func (s *S3FIFO[K, V]) Clean() {
106106 s .lock .Lock ()
107107 defer s .lock .Unlock ()
108108
109- s .items = make (map [K ]* s3fifoEntry [V ])
109+ s .items = make (map [K ]* entry [V ])
110110 s .small = newRingBuf [K ](s .size )
111111 s .main = newRingBuf [K ](s .size )
112112 s .ghost = newBucketTable [K ](s .size )
0 commit comments