From 99be62a9b16fd7b3d1e2e17f1e571d3bef34f122 Mon Sep 17 00:00:00 2001 From: fomotrader <82184770+fomotrader@users.noreply.github.com> Date: Mon, 20 Dec 2021 13:25:46 +0400 Subject: [PATCH] accounts/abi: avoid unnecessary alloc (#24128) --- accounts/abi/unpack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/abi/unpack.go b/accounts/abi/unpack.go index ec0698493..43cd6c645 100644 --- a/accounts/abi/unpack.go +++ b/accounts/abi/unpack.go @@ -290,7 +290,7 @@ func tuplePointsTo(index int, output []byte) (start int, err error) { offset := big.NewInt(0).SetBytes(output[index : index+32]) outputLen := big.NewInt(int64(len(output))) - if offset.Cmp(big.NewInt(int64(len(output)))) > 0 { + if offset.Cmp(outputLen) > 0 { return 0, fmt.Errorf("abi: cannot marshal in to go slice: offset %v would go over slice boundary (len=%v)", offset, outputLen) } if offset.BitLen() > 63 {