From: Lowell Mower Date: Fri, 9 Mar 2018 15:45:36 +0000 (-0500) Subject: c++11 loop style for countServerUp() X-Git-Tag: dnsdist-1.3.0~44^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=216f5b41f16f30c92c9afa1756cd91e2d04d2771;p=thirdparty%2Fpdns.git c++11 loop style for countServerUp() --- 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; }; };