Sfoglia il codice sorgente

accounts/abi: refactor Method#Sig() to use index in range iterator directly (#17198)

Roc Yu 7 anni fa
parent
commit
040dd5bd5d
1 ha cambiato i file con 1 aggiunte e 3 eliminazioni
  1. 1 3
      accounts/abi/method.go

+ 1 - 3
accounts/abi/method.go

@@ -47,10 +47,8 @@ type Method struct {
 // Please note that "int" is substitute for its canonical representation "int256"
 func (method Method) Sig() string {
 	types := make([]string, len(method.Inputs))
-	i := 0
-	for _, input := range method.Inputs {
+	for i, input := range method.Inputs {
 		types[i] = input.Type.String()
-		i++
 	}
 	return fmt.Sprintf("%v(%v)", method.Name, strings.Join(types, ","))
 }