Skip to content

Commit

Permalink
refactor: using slices.Contains to simplify the code (#23175)
Browse files Browse the repository at this point in the history
Signed-off-by: luchenhan <[email protected]>
  • Loading branch information
luchenhan authored Jan 6, 2025
1 parent 787a713 commit ec13857
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions baseapp/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"slices"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -115,12 +116,7 @@ func (app *BaseApp) registerABCIListenerPlugin(
}

func exposeAll(list []string) bool {
for _, ele := range list {
if ele == "*" {
return true
}
}
return false
return slices.Contains(list, "*")
}

func exposeStoreKeysSorted(keysStr []string, keys map[string]*storetypes.KVStoreKey) []storetypes.StoreKey {
Expand Down

0 comments on commit ec13857

Please sign in to comment.