Skip to content

Commit 77d5ecc

Browse files
committed
fixed compilation
1 parent 438ff11 commit 77d5ecc

File tree

4 files changed

+1
-15
lines changed

4 files changed

+1
-15
lines changed

lfu/lfu.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package lfu
33
import (
44
"container/heap"
55
"sync"
6-
7-
cache "github.com/Code-Hex/go-generics-cache"
86
)
97

108
// Cache is a thread safe LRU cache
@@ -15,8 +13,6 @@ type Cache[K comparable, V any] struct {
1513
mu sync.RWMutex
1614
}
1715

18-
var _ cache.Interface[interface{}, any] = (*Cache[interface{}, any])(nil)
19-
2016
// NewCache creates a new LFU cache whose capacity is the default size (128).
2117
func NewCache[K comparable, V any]() *Cache[K, V] {
2218
return NewCacheWithCap[K, V](128)

lfu/priotiry_queue.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package lfu
33
import (
44
"container/heap"
55
"time"
6-
7-
cache "github.com/Code-Hex/go-generics-cache"
86
)
97

108
type entry[K comparable, V any] struct {
@@ -15,7 +13,7 @@ type entry[K comparable, V any] struct {
1513
referencedAt time.Time
1614
}
1715

18-
func newEntry[K comparable, V any](key K, val V, opts ...cache.ItemOption) *entry[K, V] {
16+
func newEntry[K comparable, V any](key K, val V) *entry[K, V] {
1917
return &entry[K, V]{
2018
index: 0,
2119
key: key,

lru/lru.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package lru
33
import (
44
"container/list"
55
"sync"
6-
7-
cache "github.com/Code-Hex/go-generics-cache"
86
)
97

108
// Cache is a thread safe LRU cache
@@ -20,8 +18,6 @@ type entry[K comparable, V any] struct {
2018
val V
2119
}
2220

23-
var _ cache.Interface[interface{}, any] = (*Cache[interface{}, any])(nil)
24-
2521
// NewCache creates a new LRU cache whose capacity is the default size (128).
2622
func NewCache[K comparable, V any]() *Cache[K, V] {
2723
return NewCacheWithCap[K, V](128)

simple/simple.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"sort"
55
"sync"
66
"time"
7-
8-
cache "github.com/Code-Hex/go-generics-cache"
97
)
108

119
// Cache is a simple cache has no clear priority for evict cache.
@@ -19,8 +17,6 @@ type entry[V any] struct {
1917
createdAt time.Time
2018
}
2119

22-
var _ cache.Interface[interface{}, any] = (*Cache[interface{}, any])(nil)
23-
2420
// NewCache creates a new cache.
2521
func NewCache[K comparable, V any]() *Cache[K, V] {
2622
return &Cache[K, V]{

0 commit comments

Comments
 (0)