mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
accounts/abi/abigen: prealloc slice
This commit is contained in:
parent
ef815c59a2
commit
c1edd8397a
1 changed files with 1 additions and 1 deletions
|
|
@ -276,7 +276,7 @@ func parseLibraryDeps(unlinkedCode string) (res []string) {
|
||||||
// onItem on each. If the callback returns an error, iteration is halted and
|
// onItem on each. If the callback returns an error, iteration is halted and
|
||||||
// the error is returned from iterSorted.
|
// the error is returned from iterSorted.
|
||||||
func iterSorted[V any](inp map[string]V, onItem func(string, V) error) error {
|
func iterSorted[V any](inp map[string]V, onItem func(string, V) error) error {
|
||||||
var sortedKeys []string
|
sortedKeys := make([]string, 0, len(inp))
|
||||||
for key := range inp {
|
for key := range inp {
|
||||||
sortedKeys = append(sortedKeys, key)
|
sortedKeys = append(sortedKeys, key)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue