优化代码结构,移除未使用的依赖和冗余代码
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/mhmtszr/concurrent-swiss-map/maphash"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
|
||||
"github.com/mhmtszr/concurrent-swiss-map/swiss"
|
||||
)
|
||||
@@ -17,7 +16,7 @@ type CsMap[K comparable, V any] struct {
|
||||
shards []shard[K, V]
|
||||
shardCount uint64
|
||||
size uint64
|
||||
pool *ants.Pool
|
||||
//pool *ants.Pool
|
||||
}
|
||||
|
||||
type HashShardPair[K comparable, V any] struct {
|
||||
@@ -48,7 +47,7 @@ func New[K comparable, V any](options ...OptFunc[K, V]) *CsMap[K, V] {
|
||||
for i := 0; i < int(m.shardCount); i++ {
|
||||
m.shards[i] = shard[K, V]{items: swiss.NewMap[K, V](uint32((m.size / m.shardCount) + 1)), RWMutex: &sync.RWMutex{}}
|
||||
}
|
||||
m.pool, _ = ants.NewPool(-1)
|
||||
//m.pool, _ = ants.NewPool(-1)
|
||||
return &m
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user