Skip to content

Commit

Permalink
chore: fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
egonspace committed May 20, 2021
1 parent 3221c32 commit 19d7180
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions x/params/types/subspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ const (
// Transient store persists for a block, so we use it for
// recording whether the parameter has been changed or not
type Subspace struct {
cdc codec.BinaryMarshaler
legacyAmino *codec.LegacyAmino
key sdk.StoreKey // []byte -> []byte, stores parameter
tkey sdk.StoreKey // []byte -> bool, stores parameter change
name []byte
table KeyTable
cdc codec.BinaryMarshaler
legacyAmino *codec.LegacyAmino
key sdk.StoreKey // []byte -> []byte, stores parameter
tkey sdk.StoreKey // []byte -> bool, stores parameter change
name []byte
table KeyTable
}

// NewSubspace constructs a store with namestore
Expand Down Expand Up @@ -201,10 +201,7 @@ func (s *Subspace) hasCache(key []byte) bool {
panic(fmt.Sprintf("parameter %s not registered", string(key)))
}
cachedValuePtr := (*reflect.Value)(atomic.LoadPointer(&attr.cachedValue))
if cachedValuePtr == nil {
return false
}
return true
return cachedValuePtr != nil
}

func (s *Subspace) loadFromCache(key []byte, value interface{}) bool {
Expand Down Expand Up @@ -235,7 +232,7 @@ func (s *Subspace) HasCacheForTesting(key []byte) bool {
}

// Only for test
func (s*Subspace) SetCacheForTesting(key []byte, value interface{}) {
func (s *Subspace) SetCacheForTesting(key []byte, value interface{}) {
s.cacheValue(key, value)
}

Expand Down

0 comments on commit 19d7180

Please sign in to comment.