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

Use self instead of &self during decompression #824

Merged
merged 10 commits into from
Sep 16, 2024

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Sep 12, 2024

Just move self during deserialization since in most cases we will do nothing with it.

@xgreenx xgreenx requested a review from a team September 12, 2024 17:22
@xgreenx xgreenx self-assigned this Sep 12, 2024
netrome
netrome previously approved these changes Sep 12, 2024
Copy link
Contributor

@netrome netrome left a comment

Choose a reason for hiding this comment

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

Looks correct to me. However, it is not obvious to me what the benefit of doing this are. What do we gain by taking ownership/moving the compressed value as opposed to reading it over a reference?

The only obvious improvement I can see is for PoliciesBits where we skip a redundant dereferencing operation, but for UtxoId and impl_substitutable_key we need to create new references within the functions instead.

@xgreenx
Copy link
Collaborator Author

xgreenx commented Sep 12, 2024

It has more sense in the case of messages and coins(predicate data for example, where we just move vector instead of cloning it).

@netrome
Copy link
Contributor

netrome commented Sep 12, 2024

It has more sense in the case of messages and coins(predicate data for example, where we just move vector instead of cloning it).

Alright, makes sense. Thanks for clarifying!

rafal-ch
rafal-ch previously approved these changes Sep 13, 2024
Copy link
Contributor

@rafal-ch rafal-ch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Dentosal
Dentosal previously approved these changes Sep 16, 2024
Base automatically changed from feature/return-back-json-format-policies to master September 16, 2024 16:01
@xgreenx xgreenx dismissed stale reviews from rafal-ch, netrome, and Dentosal September 16, 2024 16:01

The base branch was changed.

…pression

# Conflicts:
#	CHANGELOG.md
#	fuel-tx/src/transaction/policies.rs
@xgreenx xgreenx added this pull request to the merge queue Sep 16, 2024
Merged via the queue into master with commit c21af9c Sep 16, 2024
39 checks passed
@xgreenx xgreenx deleted the feature/move-value-during-decompression branch September 16, 2024 22:44
@xgreenx xgreenx mentioned this pull request Sep 17, 2024
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.

4 participants