From 92d22549ea0d15c1cfa99e5532b915497285c71a Mon Sep 17 00:00:00 2001 From: vimes Date: Tue, 17 Dec 2024 18:14:50 +0300 Subject: [PATCH] Reserves --- controlplane/balancer.cpp | 1 + dataplane/globalbase.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/controlplane/balancer.cpp b/controlplane/balancer.cpp index 4c1df123..339ec3b9 100644 --- a/controlplane/balancer.cpp +++ b/controlplane/balancer.cpp @@ -982,6 +982,7 @@ bool balancer_t::reconfigure_wlc() } std::vector> service_reals_usage_info; + service_reals_usage_info.reserve(reals.size()); uint32_t connection_sum = 0; uint32_t weight_sum = 0; diff --git a/dataplane/globalbase.cpp b/dataplane/globalbase.cpp index d802f671..2a761c8c 100644 --- a/dataplane/globalbase.cpp +++ b/dataplane/globalbase.cpp @@ -1646,6 +1646,7 @@ balancer_real_id_t* generation::rebuild_service_ring_one_wrr( std::vector generation::ServiceWeights(const balancer_service_t& service) { std::vector weights; + weights.reserve(service.real_size); for (uint32_t real_idx = service.real_start; real_idx < service.real_start + service.real_size; ++real_idx)