Follow-up PR for #27257
- Deletes the copy constructor/assignment operator of
CNetMessage - Removes trivial getter for the connection type
- Avoids passing
nRecvFloodSizeto CNode methods by passing it toCNodeon creation
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
235 | @@ -236,6 +236,10 @@ class CNetMessage { 236 | std::string m_type; 237 | 238 | CNetMessage(CDataStream&& recv_in) : m_recv(std::move(recv_in)) {} 239 | + CNetMessage(CNetMessage&&) = default;
Perhaps add a comment on why we don't want to copy CNetMessage objects.
Done! happy to amend the comment if you had something different in mind.
This is absolutely fine. I would have gone for something like "For performance reasons, once we've deserialized the bytes into a CNetMessage, we avoid re-allocating and copying the message as we pass it up the stack for processing. Delete the copy ctor/assignment to avoid accidentally introducing a copy operation.", which is more-or-less the same as what you came up with.
utACK f824725be383e89346e2dc3269cc3d6aa533bcd3
One suggestion inline if you touch this PR again.
ACK cd0c8eeb0940790b6ba83786d1c9e362d4dc4829
utACK cd0c8eeb0940790b6ba83786d1c9e362d4dc4829