In `QuicSelfIssuedConnectionIdManager::GetUnretiredConnectionIds`, call `std::vector::reserve` before the for loops to avoid unnecessary memory allocations.
PiperOrigin-RevId: 705615505
diff --git a/quiche/quic/core/quic_connection_id_manager.cc b/quiche/quic/core/quic_connection_id_manager.cc
index 253d3bd..74d3a51 100644
--- a/quiche/quic/core/quic_connection_id_manager.cc
+++ b/quiche/quic/core/quic_connection_id_manager.cc
@@ -379,6 +379,8 @@
std::vector<QuicConnectionId>
QuicSelfIssuedConnectionIdManager::GetUnretiredConnectionIds() const {
std::vector<QuicConnectionId> unretired_ids;
+ unretired_ids.reserve(to_be_retired_connection_ids_.size() +
+ active_connection_ids_.size());
for (const auto& cid_pair : to_be_retired_connection_ids_) {
unretired_ids.push_back(cid_pair.first);
}