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

This commit is contained in:
Roc Yu 2018-07-19 16:42:47 +08:00 committed by Péter Szilágyi
parent dcdd57df62
commit 040dd5bd5d
1 changed files with 1 additions and 3 deletions

View File

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