Skip to content

Commit 1c8ff5c

Browse files
authored
refactor: replace Split in loops with more efficient SplitSeq (#1561)
Signed-off-by: sunnyraindy <[email protected]>
1 parent 0eb84a1 commit 1c8ff5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/mnemonic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (m Mnemonic) _Indices() ([]int, error) {
131131
var check bool
132132
temp := strings.Split(m.words, " ")
133133
if len(temp) == 22 { // nolint
134-
for _, mnemonicString := range strings.Split(m.words, " ") {
134+
for mnemonicString := range strings.SplitSeq(m.words, " ") {
135135
check = false
136136
for i, stringCheck := range legacy {
137137
if mnemonicString == stringCheck {
@@ -144,7 +144,7 @@ func (m Mnemonic) _Indices() ([]int, error) {
144144
}
145145
}
146146
} else if len(temp) == 24 {
147-
for _, mnemonicString := range strings.Split(m.words, " ") {
147+
for mnemonicString := range strings.SplitSeq(m.words, " ") {
148148
t, check := GetWordIndex(mnemonicString)
149149
if !check {
150150
return make([]int, 0), ErrInvalidMnemonic

0 commit comments

Comments
 (0)