Skip to content

Commit

Permalink
Deletes early iterator returns (#441)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel <[email protected]>
  • Loading branch information
danwt and Daniel authored Nov 8, 2022
1 parent d9a002f commit 256c26b
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions x/ccv/provider/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:])
Expand Down Expand Up @@ -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:])
Expand Down

0 comments on commit 256c26b

Please sign in to comment.