mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
fixup! perf: use strings.Builder
This commit is contained in:
parent
1625a322f4
commit
c9dd414f3c
1 changed files with 1 additions and 3 deletions
|
|
@ -73,12 +73,10 @@ func parseElementaryType(unescapedSelector string) (string, string, error) {
|
||||||
for len(rest) > 0 && rest[0] == '[' {
|
for len(rest) > 0 && rest[0] == '[' {
|
||||||
parsedTypeSb71.WriteString(string(rest[0]))
|
parsedTypeSb71.WriteString(string(rest[0]))
|
||||||
rest = rest[1:]
|
rest = rest[1:]
|
||||||
var parsedTypeSb74 strings.Builder
|
|
||||||
for len(rest) > 0 && isDigit(rest[0]) {
|
for len(rest) > 0 && isDigit(rest[0]) {
|
||||||
parsedTypeSb74.WriteString(string(rest[0]))
|
parsedTypeSb71.WriteString(string(rest[0]))
|
||||||
rest = rest[1:]
|
rest = rest[1:]
|
||||||
}
|
}
|
||||||
parsedType += parsedTypeSb74.String()
|
|
||||||
if len(rest) == 0 || rest[0] != ']' {
|
if len(rest) == 0 || rest[0] != ']' {
|
||||||
return "", "", fmt.Errorf("failed to parse array: expected ']', got %c", unescapedSelector[0])
|
return "", "", fmt.Errorf("failed to parse array: expected ']', got %c", unescapedSelector[0])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue