优化代码结构,移除未使用的依赖和冗余代码

This commit is contained in:
1
2026-01-26 14:12:12 +00:00
parent c42650145d
commit 1a95ce8c48
6 changed files with 50 additions and 27 deletions

View File

@@ -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
}