[net] Don't return an optional from TransportDeserializer::GetMessage()#22735
Merged
maflcko merged 2 commits intobitcoin:masterfrom Nov 2, 2021
Merged
[net] Don't return an optional from TransportDeserializer::GetMessage()#22735maflcko merged 2 commits intobitcoin:masterfrom
maflcko merged 2 commits intobitcoin:masterfrom
Conversation
Contributor
Author
|
This is #20364, rebased on master. Requesting rereview from @ryanofsky @MarcoFalke and @ajtowns, who reviewed the original PR. |
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
Also, access mapRecvBytesPerMsgCmd with `at()` not `find()`. This throws an error if COMMAND_OTHER doesn't exist, which should never happen. `find()` instead just accessed the last element, which could make debugging more difficult. Resolves review comments from PR19107: - bitcoin#19107 (comment) - bitcoin#19107 (comment)
0bf1ebf to
f3e451b
Compare
Contributor
|
Concept ACK |
maflcko
reviewed
Oct 11, 2021
ryanofsky
approved these changes
Nov 1, 2021
Contributor
ryanofsky
left a comment
There was a problem hiding this comment.
Code review ACK f3e451b. Changes since last review in #20364 (review) were simplifying by dropping the third commit, rebasing, and cleaning up some style & comments in the first commit.
The cleanups here are all small and straightforward, but I think the best one is getting rid of the unchecked map.find iterator dereference, and getting rid of the redundant & sometimes initialized out_err_raw_size output parameter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also, access mapRecvBytesPerMsgCmd with
at()notfind(). Thisthrows an error if COMMAND_OTHER doesn't exist, which should never
happen.
find()instead just accessed the last element, which could makedebugging more difficult.
Resolves review comments from PR19107: