]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use at(i) instead of [i] 13208/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 5 Sep 2023 10:40:50 +0000 (12:40 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 5 Sep 2023 11:08:37 +0000 (13:08 +0200)
pdns/dnsdistdist/dnsdist-lbpolicies.cc

index 2a890f2e554ab51326b63d219a892564fcadad32..783b5ae21ae8455919c132014ca3e9a8b515d71f 100644 (file)
@@ -41,7 +41,7 @@ template <class T> static std::shared_ptr<DownstreamState> getLeastOutstanding(c
   size_t usableServers = 0;
   for (const auto& d : servers) {
     if (d.second->isUp()) {
-      poss[usableServers] = std::pair(std::tuple(d.second->outstanding.load(), d.second->d_config.order, d.second->getRelevantLatencyUsec()), d.first);
+      poss.at(usableServers) = std::pair(std::tuple(d.second->outstanding.load(), d.second->d_config.order, d.second->getRelevantLatencyUsec()), d.first);
       usableServers++;
     }
   }
@@ -101,7 +101,7 @@ template <class T> static std::shared_ptr<DownstreamState> getValRandom(const Se
         sum += d.second->d_config.d_weight;
       }
 
-      poss[usableServers]  = std::pair(sum, d.first);
+      poss.at(usableServers) = std::pair(sum, d.first);
       usableServers++;
     }
   }