Skip to content

Commit 99be62a

Browse files
authored
accounts/abi: avoid unnecessary alloc (#24128)
1 parent 8bbf83e commit 99be62a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

accounts/abi/unpack.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func tuplePointsTo(index int, output []byte) (start int, err error) {
290290
offset := big.NewInt(0).SetBytes(output[index : index+32])
291291
outputLen := big.NewInt(int64(len(output)))
292292

293-
if offset.Cmp(big.NewInt(int64(len(output)))) > 0 {
293+
if offset.Cmp(outputLen) > 0 {
294294
return 0, fmt.Errorf("abi: cannot marshal in to go slice: offset %v would go over slice boundary (len=%v)", offset, outputLen)
295295
}
296296
if offset.BitLen() > 63 {

0 commit comments

Comments
 (0)