Skip to content

Commit ec13857

Browse files
authored
refactor: using slices.Contains to simplify the code (#23175)
Signed-off-by: luchenhan <hanluchen@aliyun.com>
1 parent 787a713 commit ec13857

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

baseapp/streaming.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"slices"
78
"sort"
89
"strconv"
910
"strings"
@@ -115,12 +116,7 @@ func (app *BaseApp) registerABCIListenerPlugin(
115116
}
116117

117118
func exposeAll(list []string) bool {
118-
for _, ele := range list {
119-
if ele == "*" {
120-
return true
121-
}
122-
}
123-
return false
119+
return slices.Contains(list, "*")
124120
}
125121

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

0 commit comments

Comments
 (0)