mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
accounts/abi: only loop once
This commit is contained in:
parent
97e2d5aeb7
commit
f829928fb1
1 changed files with 5 additions and 10 deletions
|
|
@ -182,17 +182,12 @@ func (arguments Arguments) copyTuple(v interface{}, marshalledValues []interface
|
||||||
// without supplying a struct to unpack into. Instead, this method returns a list containing the
|
// without supplying a struct to unpack into. Instead, this method returns a list containing the
|
||||||
// values. An atomic argument will be a list with one element.
|
// values. An atomic argument will be a list with one element.
|
||||||
func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
|
func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
|
||||||
size := 0
|
var (
|
||||||
for _, arg := range arguments {
|
retval = make([]interface{}, 0)
|
||||||
if arg.Indexed {
|
virtualArgs = 0
|
||||||
continue
|
index = 0
|
||||||
}
|
)
|
||||||
size++
|
|
||||||
}
|
|
||||||
|
|
||||||
retval := make([]interface{}, 0, size)
|
|
||||||
virtualArgs := 0
|
|
||||||
index := 0
|
|
||||||
for _, arg := range arguments {
|
for _, arg := range arguments {
|
||||||
if arg.Indexed {
|
if arg.Indexed {
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue