From 80aa96ec25ef59a0cbd045e6be055a8598fd38e1 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Fri, 19 May 2023 20:02:47 +0200 Subject: [PATCH] Appease the linter Signed-off-by: Jakub Sztandera --- chain/store/index.go | 2 +- lib/shardedmutex/shardedmutex.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chain/store/index.go b/chain/store/index.go index 5807a2705..8361f4db9 100644 --- a/chain/store/index.go +++ b/chain/store/index.go @@ -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() { diff --git a/lib/shardedmutex/shardedmutex.go b/lib/shardedmutex/shardedmutex.go index 47b677f51..922ac3994 100644 --- a/lib/shardedmutex/shardedmutex.go +++ b/lib/shardedmutex/shardedmutex.go @@ -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(), }