Skip to content

Commit 230b0ef

Browse files
charles-cooperfselmo
authored andcommitted
optimize memory.write
1 parent 07dcc20 commit 230b0ef

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

eth/vm/memory.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ def write(self, start_position: int, size: int, value: bytes) -> None:
5353
validate_length(value, length=size)
5454
validate_lte(start_position + size, maximum=len(self))
5555

56-
for idx, v in enumerate(value):
57-
self._bytes[start_position + idx] = v
56+
self._bytes[start_position : start_position + len(value)] = value
5857

5958
def read(self, start_position: int, size: int) -> memoryview:
6059
return memoryview(self._bytes)[start_position : start_position + size]

0 commit comments

Comments
 (0)