Skip to content

Commit

Permalink
core/vm: optimize Memory.Set32
Browse files Browse the repository at this point in the history
  • Loading branch information
qianbin committed May 11, 2022
1 parent 05a2af4 commit 2764a1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/vm/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func (m *Memory) Set32(offset uint64, val *uint256.Int) {
panic("invalid memory: store empty")
}
// Fill in relevant bits
val.WriteToSlice(m.store[offset:])
b32 := val.Bytes32()
copy(m.store[offset:], b32[:])
}

// Resize resizes the memory to size
Expand Down

0 comments on commit 2764a1d

Please sign in to comment.