-
Notifications
You must be signed in to change notification settings - Fork 920
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: simplify some algorithms #14948
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12303894321Details
💛 - Coveralls |
e1dcdad
to
4b20984
Compare
I am a bit confused. Why prefer the boost variation of things that are available in standard C++? In general, I think the policy should be for features available both in boost and standard C++ to lean to the standard C++ variant. |
std::ranges comes in C++20. |
I know that, but what's the reason to move to |
Readability mostly. |
I am not convinced. To me this PR looks quite a lot of churn with no real benefit. |
Do note that clang-tidy makes the transformations away from boost with C++20 |
Which is in line with the policy to use std c++ if possible. I'll let the other maintainers chime in to see what they think about this. |
Thank you for this PR, but I'm afraid I'm with Otto on this one: I have been trying to reduce the use of Boost in DNSdist whenever possible. I would love to be able to use C++20 but we are not quite there yet, and in the meantime I would prefer to use std C++ whenever possible. |
Note existing calls to |
d0ce8c8
to
8fced90
Compare
OK. reduced boost usage and simplified some algorithms. What do you think? |
79a49df
to
4ff6292
Compare
pdns/dnsdistdist/dnsdist-lua.cc
Outdated
@@ -760,7 +762,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) | |||
} | |||
|
|||
dnsdist::configuration::updateRuntimeConfiguration([&server](dnsdist::configuration::RuntimeConfiguration& config) { | |||
config.d_backends.erase(std::remove(config.d_backends.begin(), config.d_backends.end(), server), config.d_backends.end()); | |||
boost::range::remove_erase(config.d_backends, server); |
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 would rather not introduce a boost::range
for such a trivial change.
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.
Removed.
These are unused Signed-off-by: Rosen Penev <[email protected]>
Signed-off-by: Rosen Penev <[email protected]>
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.
Looks good to me now, thanks! I guess we should update the title of the PR, thought, because as it is right now it would lead to a misleading entry in the ChangeLog.
Done. |
Just a cleanup to prepare for C++20
I have: