-
Notifications
You must be signed in to change notification settings - Fork 921
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
clang-tidy: use std::min/max #14954
base: master
Are you sure you want to change the base?
clang-tidy: use std::min/max #14954
Conversation
Pull Request Test Coverage Report for Build 12403993595Details
💛 - Coveralls |
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.
Looking good, except for the seemingly unrelated change in lua-record.cc
.
pdns/lua-record.cc
Outdated
if (port > std::numeric_limits<uint16_t>::max()) { | ||
port = std::numeric_limits<uint16_t>::max(); | ||
} | ||
lua.writeFunction("ifportup", [](int port, const boost::variant<iplist_t, ipunitlist_t>& ips, const boost::optional<std::unordered_map<string, string>>& options) { |
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.
Why did you change the signature of the lambda here? (passing options
by reference)
This is not related to the algorithmic changes.
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.
Looked like a mistake
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.
I'm afraid it actually breaks the feature because the options
parameter is no longer optional.
pdns/lua-record.cc
Outdated
if (port > std::numeric_limits<uint16_t>::max()) { | ||
port = std::numeric_limits<uint16_t>::max(); | ||
} | ||
lua.writeFunction("ifportup", [](int port, const boost::variant<iplist_t, ipunitlist_t>& ips, const boost::optional<std::unordered_map<string, string>>& options) { |
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.
I'm afraid it actually breaks the feature because the options
parameter is no longer optional.
sounds broken. |
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.
The changes look OK to me, and we can ignore clang-tidy's warning which is incorrect. I wouldn't mind a second review from either @omoerbeek or @Habbie before merging this.
1125d42
to
eb172b3
Compare
Found with readability-use-std-min-max Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with readability-use-std-min-max
I have: