From 256c26b6f08ac3bd68ecb4ea400964b9b49a4296 Mon Sep 17 00:00:00 2001 From: Daniel T <30197399+danwt@users.noreply.github.com> Date: Tue, 8 Nov 2022 17:05:15 +0000 Subject: [PATCH] Deletes early iterator returns (#441) Co-authored-by: Daniel --- x/ccv/provider/keeper/keeper.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/x/ccv/provider/keeper/keeper.go b/x/ccv/provider/keeper/keeper.go index 4d5ff66628..ca740fa11c 100644 --- a/x/ccv/provider/keeper/keeper.go +++ b/x/ccv/provider/keeper/keeper.go @@ -143,10 +143,6 @@ func (k Keeper) IterateConsumerChains(ctx sdk.Context, cb func(ctx sdk.Context, iterator := sdk.KVStorePrefixIterator(store, []byte{types.ChainToClientBytePrefix}) defer iterator.Close() - if !iterator.Valid() { - return - } - for ; iterator.Valid(); iterator.Next() { // remove 1 byte prefix from key to retrieve chainID chainID := string(iterator.Key()[1:]) @@ -187,10 +183,6 @@ func (k Keeper) IterateChannelToChain(ctx sdk.Context, cb func(ctx sdk.Context, iterator := sdk.KVStorePrefixIterator(store, []byte{types.ChannelToChainBytePrefix}) defer iterator.Close() - if !iterator.Valid() { - return - } - for ; iterator.Valid(); iterator.Next() { // remove prefix from key to retrieve channelID channelID := string(iterator.Key()[1:])