Co-authored-by: huochexizhan <huochexizhan@outlook.com>
This commit is contained in:
co-authored by
huochexizhan
parent
e8579020cb
commit
d38bf643ed
+3
-12
@@ -3,6 +3,7 @@ package types
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"slices"
|
||||
|
||||
"github.com/cometbft/cometbft/proto/tendermint/crypto"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
@@ -85,12 +86,7 @@ func (s *StoreUpgrades) IsAdded(key string) bool {
|
||||
if s == nil {
|
||||
return false
|
||||
}
|
||||
for _, added := range s.Added {
|
||||
if key == added {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(s.Added, key)
|
||||
}
|
||||
|
||||
// IsDeleted returns true if the given key should be deleted
|
||||
@@ -98,12 +94,7 @@ func (s *StoreUpgrades) IsDeleted(key string) bool {
|
||||
if s == nil {
|
||||
return false
|
||||
}
|
||||
for _, d := range s.Deleted {
|
||||
if d == key {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(s.Deleted, key)
|
||||
}
|
||||
|
||||
// RenamedFrom returns the oldKey if it was renamed
|
||||
|
||||
Reference in New Issue
Block a user