From 216f5b41f16f30c92c9afa1756cd91e2d04d2771 Mon Sep 17 00:00:00 2001 From: Lowell Mower Date: Fri, 9 Mar 2018 10:45:36 -0500 Subject: [PATCH] c++11 loop style for countServerUp() --- pdns/dnsdist.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pdns/dnsdist.hh b/pdns/dnsdist.hh index 8b6602a4b5..c803657bde 100644 --- a/pdns/dnsdist.hh +++ b/pdns/dnsdist.hh @@ -648,12 +648,12 @@ struct ServerPool std::shared_ptr policy{nullptr}; int countServersUp() { - int upFound = 0; - for(unsigned idx=0; idx(servers[idx])->isUp() ) { + size_t upFound = 0; + for (const auto& server : servers) { + if (std::get<1>(server)->isUp() ) { upFound++; - } - } + }; + }; return upFound; }; }; -- 2.47.2