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

Moving functions into impl CompressedBlock #47

Merged

Conversation

anforowicz
Copy link
Contributor

This is motivated by the investigation from #45. At this point I am fairly sure that we will need to support different table sizes. And these 3 commits prepare for this in a fairly straighforward/non-controversial way.

PS. I also have a potential follow-up at https://github.com/anforowicz/fdeflate/tree/const-generic-table-sizes3, but I need to think more about whether making read_compressed a free function is justified. If we support 512/128 tables, then using the fixed tables directly seems like a "free" optimization. OTOH, the cost of copying fixed tables into CompressedBlock is probably not that high (i.e. the benefit is not that high).

This change is desirable for 2 reasons:

* Less important: this keeps `pub fn` together, at the top.
* More important: this places `fn build_tables` and `fn read_compressed`
  at the end of the `impl` block, making it easier to move them into
  `impl CompressedBlock` (without moving them within the source file).
@anforowicz anforowicz changed the title Moving functions into impl compressed block Moving functions into impl CompressedBlock Jan 7, 2025
@kornelski kornelski merged commit 7ded2fa into image-rs:main Jan 7, 2025
10 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.

2 participants