diff --git a/modules/capability/CHANGELOG.md b/modules/capability/CHANGELOG.md index cf6d1b30cae..472e0e358ed 100644 --- a/modules/capability/CHANGELOG.md +++ b/modules/capability/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * [\#4068](https://github.com/cosmos/ibc-go/pull/4068) Various improvements made to testing to reduce the dependency tree and use new cosmos-sdk test utils. +* [\#4770](https://github.com/cosmos/ibc-go/pull/4770) Save gas on `IsInitialized`, use `Has` in favour of `Get`. ### Features diff --git a/modules/capability/keeper/keeper.go b/modules/capability/keeper/keeper.go index 3283449b5aa..0b641df3db7 100644 --- a/modules/capability/keeper/keeper.go +++ b/modules/capability/keeper/keeper.go @@ -148,7 +148,7 @@ func (k *Keeper) InitMemStore(ctx sdk.Context) { // IsInitialized returns true if the keeper is properly initialized, and false otherwise. func (k *Keeper) IsInitialized(ctx sdk.Context) bool { memStore := ctx.KVStore(k.memKey) - return memStore.Get(types.KeyMemInitialized) != nil + return memStore.Has(types.KeyMemInitialized) } // InitializeIndex sets the index to one (or greater) in InitChain according