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

Serialize decorator data at the end #1531

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

yasonk
Copy link

@yasonk yasonk commented Oct 13, 2024

Describe your changes

Moving all decorator data to the end in order to enable truncating it later. See issue #1489

Contains a minor refactor to make writing decorator info more direct by reducing interconnected layers of indirection.
Also extracted some functions from the Serializer code to make it easer follow.

Checklist before requesting a review

  • Repo forked and branch created from next according to naming convention.
  • Commit messages and codestyle follow conventions.
  • Relevant issues are linked in the PR description.
  • Tests added for new functionality. (No new tests)
  • Documentation/comments updated according to changes. (No Doc changes)

) -> Self {
let variant = EncodedDecoratorVariant::from(decorator);
let decorator_data_offset =
Copy link
Author

Choose a reason for hiding this comment

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

Making things a bit more direct. To calculate decorator offset, this used to make a call to an argument passed into this function using two other arguments passed into this function.

*MAGIC, magic
)));
}
read_and_validate_magic(source)?;
Copy link
Author

Choose a reason for hiding this comment

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

Having a single line of code for each item being read, improves readability of this method

@yasonk yasonk force-pushed the serialize-decorator-data-at-the-end branch from 2ade28c to eb59ff3 Compare October 13, 2024 02:07
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