Skip to content

Refactor: Simplify find_frame logic#7

Open
insalt-glitch wants to merge 4 commits intoOceanOptics:masterfrom
insalt-glitch:find_frame_logic
Open

Refactor: Simplify find_frame logic#7
insalt-glitch wants to merge 4 commits intoOceanOptics:masterfrom
insalt-glitch:find_frame_logic

Conversation

@insalt-glitch
Copy link
Copy Markdown
Contributor

This PR is a minor refactor for the ACS.find_frame logic. In particular, the buffer size is checked once to make sure it contains the entire frame. This eliminates the need for the try-catch block and some of the other checks. The functionality of ACS.find_frame remains unchanged.

Nils Müller added 4 commits April 3, 2026 13:46
Inside ACS.find_frame only ACS.valid_frame uses struct.unpack_from
which can never throw struct_error because the bytearray garanteed
to have the required length (see acs.py:396).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant