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
net: make the list of known message types a compile time constant #29421
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee 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. ConflictsReviewers, 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. |
Concept ACK 2e312ea. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2e312ea
to
808fe4e
Compare
|
808fe4e
to
c29350f
Compare
c29350f
to
c7c613c
Compare
Concept ACK |
Seems fine, but NACK on the approach. This switches a vector of |
c7c613c
to
fd6a481
Compare
|
fd6a481
to
546d132
Compare
@maflcko good point! Changed from |
Turn the `std::vector` to `std::array` because it is cheaper and allows us to have the number of the messages as a compile time constant: `ALL_NET_MESSAGE_TYPES.size()` which can be used in future code to build other `std::array`s with that size.
As a side effect the names of the constants do not have to be repeated in `src/protocol.cpp`.
546d132
to
b3efb48
Compare
|
@maflcko, this has a NACK from you and I have addressed your concern. If not ACK, it would be nice if you can at least remove your NACK. Thanks for the review so far! |
ping @maflcko |
Turn the
std::vector
tostd::array
because it is cheaper and allows us to have the number of the messages as a compile time constant:ALL_NET_MESSAGE_TYPES.size()
which can be used in future code to build otherstd::array
s with that size.This change is part of #29418 but it makes sense on its own and would be good to have it, regardless of the fate of #29418. Also, if this is merged, that would reduce the size of #29418, thus the current standalone PR.