From c5c876a7e76e3d37282bef29a7981ffa41197f22 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Tue, 14 Jan 2025 10:56:07 +0800 Subject: [PATCH] accounts/abi: refactor Method#Sig() to use index in range iterator directly (#17198) --- accounts/abi/method.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/accounts/abi/method.go b/accounts/abi/method.go index 46beedefb6..d49e555c94 100644 --- a/accounts/abi/method.go +++ b/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, ",")) }