Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a memoryview when processing bytes in the frame helper #611

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aioesphomeapi/_frame_helper/noise.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cdef class APINoiseFrameHelper(APIFrameHelper):
cdef bint _is_ready

@cython.locals(
header=bytes,
header="const unsigned char[:]",
preamble=cython.uint,
msg_size_high=cython.uint,
msg_size_low=cython.uint,
Expand Down
4 changes: 2 additions & 2 deletions aioesphomeapi/_frame_helper/plain_text.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ cdef object bytes_to_varuint, varuint_to_bytes
cpdef _varuint_to_bytes(cython.int value)

@cython.locals(result=cython.int, bitpos=cython.int, val=cython.int)
cpdef _bytes_to_varuint(cython.bytes value)
cpdef _bytes_to_varuint(const unsigned char[:] value)

cdef class APIPlaintextFrameHelper(APIFrameHelper):

@cython.locals(
msg_type=bytes,
length=bytes,
init_bytes=bytes,
init_bytes="const unsigned char[:]",
add_length=bytes,
end_of_frame_pos=cython.uint,
length_int=cython.uint,
Expand Down
Loading