Skip to content

Commit b3cdc63

Browse files
authored
fix: use slices.Contains instead of for loop (#346)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent f2a5bd6 commit b3cdc63

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

internal/config/profile.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
package config
88

9+
import "slices"
10+
911
type Profile struct {
1012
Network string // Cardano network name
1113
Tld string // Top-level domain
@@ -19,11 +21,8 @@ type Profile struct {
1921
func GetProfiles() []Profile {
2022
var ret []Profile
2123
for k, profile := range Profiles {
22-
for _, tmpProfile := range globalConfig.Profiles {
23-
if k == tmpProfile {
24-
ret = append(ret, profile)
25-
break
26-
}
24+
if slices.Contains(globalConfig.Profiles, k) {
25+
ret = append(ret, profile)
2726
}
2827
}
2928
return ret

0 commit comments

Comments
 (0)