Skip to content

Commit

Permalink
Appease the linter
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Jakub Sztandera committed May 19, 2023
1 parent dfa7fc7 commit cad743e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chain/store/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
10 changes: 5 additions & 5 deletions lib/shardedmutex/shardedmutex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

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

0 comments on commit cad743e

Please sign in to comment.