Skip to content

Optimize length storage#166

Merged
sasial-dev merged 3 commits intored-blox:0.6.xfrom
daimond113:feat/optimize-length-storage
Mar 2, 2025
Merged

Optimize length storage#166
sasial-dev merged 3 commits intored-blox:0.6.xfrom
daimond113:feat/optimize-length-storage

Conversation

@daimond113
Copy link
Copy Markdown
Contributor

Storing lengths was hardcoded to u16, even when a different type would be better. So, now if the range of length is known it'll be used to serialize the length in the fitting size.

This currently requires explicit minimum values (0..255). Should a minimum of 0 be default?

@sasial-dev
Copy link
Copy Markdown
Collaborator

I think that a minimum of 0 should be the default, yes. As you'll never have a negative length string/buffer/array etc.

Copy link
Copy Markdown
Collaborator

@sasial-dev sasial-dev left a comment

Choose a reason for hiding this comment

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

Other than this comment, LGTM

Co-authored-by: Sasial <44125644+sasial-dev@users.noreply.github.com>
@sasial-dev sasial-dev merged commit 46a7206 into red-blox:0.6.x Mar 2, 2025
2 checks passed
@sasial-dev
Copy link
Copy Markdown
Collaborator

Thank you!

@sasial-dev sasial-dev self-assigned this Mar 2, 2025
daimond113 added a commit to daimond113/zap that referenced this pull request Mar 15, 2025
sasial-dev pushed a commit that referenced this pull request Mar 16, 2025
* Fix inaccurate Ty::size values after #166

* Run rustfmt
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