Skip to content

Commit 2764a1d

Browse files
committed
core/vm: optimize Memory.Set32
1 parent 05a2af4 commit 2764a1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/vm/memory.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ func (m *Memory) Set32(offset uint64, val *uint256.Int) {
5656
panic("invalid memory: store empty")
5757
}
5858
// Fill in relevant bits
59-
val.WriteToSlice(m.store[offset:])
59+
b32 := val.Bytes32()
60+
copy(m.store[offset:], b32[:])
6061
}
6162

6263
// Resize resizes the memory to size

0 commit comments

Comments
 (0)