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

wire: Write message header directly. #2790

Merged
merged 1 commit into from Nov 10, 2021

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented Nov 8, 2021

This modifies the message writing code that writes out message headers to write the fields directly instead of creating a copy of the data first.

The primary motivation for this change is that the hdr.command field is assigned and never used in the existing code because the size-limited array variant of the command field is used instead when writing the elements. Since that field is unused, rather than creating a local partially-filled message header, and copying data into it only to turn around and write that data immediately, it makes more sense to just write the data directly.

@davecgh davecgh added this to the 1.7.0 milestone Nov 8, 2021
This modifies the message writing code that writes out message headers
to write the fields directly instead of creating a copy of the data
first.

The primary motivation for this change is that the hdr.command field is
assigned and never used in the existing code because the size-limited
array variant of the command field is used instead when writing the
elements.  Since that field is unused, rather than creating a local
partially-filled message header, and copying data into it only to turn
around and write that data immediately, it makes more sense to just
write the data directly.
@davecgh davecgh merged commit e430a7f into decred:master Nov 10, 2021
@davecgh davecgh deleted the wire_unused_header_field branch November 10, 2021 13:31
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

3 participants