Appease the linter

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2023-05-19 20:02:47 +02:00
parent dfa7fc7723
commit cad743ec54
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
2 changed files with 6 additions and 6 deletions

View File

@ -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() {

View File

@ -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(),
}