diff --git a/wallet/builder.go b/wallet/builder.go index ef05301..52532a7 100644 --- a/wallet/builder.go +++ b/wallet/builder.go @@ -164,13 +164,9 @@ func (b *V1Builder) buildInput(src *Transfer) (types.TxInputToKey, inputMeta, er }) // Find real index after sorting. - realIdx := -1 - for j, m := range ring { - if m.GlobalIndex == src.GlobalIndex { - realIdx = j - break - } - } + realIdx := slices.IndexFunc(ring, func(m RingMember) bool { + return m.GlobalIndex == src.GlobalIndex + }) if realIdx < 0 { return types.TxInputToKey{}, inputMeta{}, errors.New("real output not found in ring") }