Skip to content

Commit f4c1b0c

Browse files
glyphKriechi
authored andcommitted
don't unnecessarily construct bytearrays over and over again
1 parent 173c7d2 commit f4c1b0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wsproto/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def events(self) -> Generator[Event, None, None]:
191191
elif frame.opcode is Opcode.BINARY:
192192
assert isinstance(frame.payload, (bytes, bytearray))
193193
yield BytesMessage(
194-
data=bytearray(frame.payload),
194+
data=frame.payload,
195195
frame_finished=frame.frame_finished,
196196
message_finished=frame.message_finished,
197197
)

0 commit comments

Comments
 (0)