Appease the linter
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
b65c93b2b4
commit
80aa96ec25
@ -15,7 +15,7 @@ import (
|
||||
"github.com/filecoin-project/lotus/lib/shardedmutex"
|
||||
)
|
||||
|
||||
// DefaultChainIndexCacheSize no longer sets the maximum size, just the inital size of the map.
|
||||
// DefaultChainIndexCacheSize no longer sets the maximum size, just the initial size of the map.
|
||||
var DefaultChainIndexCacheSize = 1 << 15
|
||||
|
||||
func init() {
|
||||
|
@ -20,12 +20,12 @@ type ShardedMutex struct {
|
||||
}
|
||||
|
||||
// New creates a new ShardedMutex with N shards
|
||||
func New(n_shards int) ShardedMutex {
|
||||
if n_shards < 1 {
|
||||
func New(nShards int) ShardedMutex {
|
||||
if nShards < 1 {
|
||||
panic("n_shards cannot be less than 1")
|
||||
}
|
||||
return ShardedMutex{
|
||||
shards: make([]paddedMutex, n_shards),
|
||||
shards: make([]paddedMutex, nShards),
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,9 +52,9 @@ type ShardedMutexFor[K any] struct {
|
||||
seed maphash.Seed
|
||||
}
|
||||
|
||||
func NewFor[K any](hasher func(maphash.Seed, K) uint64, n_shards int) ShardedMutexFor[K] {
|
||||
func NewFor[K any](hasher func(maphash.Seed, K) uint64, nShards int) ShardedMutexFor[K] {
|
||||
return ShardedMutexFor[K]{
|
||||
inner: New(n_shards),
|
||||
inner: New(nShards),
|
||||
hasher: hasher,
|
||||
seed: maphash.MakeSeed(),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user