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

note an assumed invariant that may not be obvious #8666

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

jepler
Copy link
Member

@jepler jepler commented Nov 28, 2023

an assumption recently added in #8655

@dhalbert dhalbert changed the title note an assmued invariant that may not be obvious note an assumed invariant that may not be obvious Nov 28, 2023
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know the length of the decompressed string? Suppose the buffer is too short, what happens? Is it OK if the buffer is larger than necessary?

@jepler
Copy link
Member Author

jepler commented Nov 28, 2023

This is just a note about the internal API (the function I'm commenting is a new static function added in #8655). The message length comes from decompress_length(message) and implementation wise it's stored as the first bits of the message itself. this was more efficient than storing a huffman-encoded NUL byte at the end of the str.

@dhalbert dhalbert merged commit 949a906 into adafruit:main Nov 28, 2023
474 checks passed
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.

None yet

2 participants