Skip to content

Commit 06a5723

Browse files
tniessenpull[bot]
authored andcommitted
quic: prevent copying ngtcp2_cid
The existing code explicitly uses the CID(const ngtcp2_cid*) constructor that does not copy the given ngtcp2_cid, but the range-based for loop still unnecessarily copies the ngtcp2_cid. Use auto& to avoid copying. PR-URL: #48561 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
1 parent 4fdfce1 commit 06a5723

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/quic/session.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ void Session::Destroy() {
643643
endpoint_->DisassociateCID(config_.dcid);
644644
endpoint_->DisassociateCID(config_.preferred_address_cid);
645645

646-
for (auto cid : cids) endpoint_->DisassociateCID(CID(&cid));
646+
for (const auto& cid : cids) endpoint_->DisassociateCID(CID(&cid));
647647

648648
for (const auto& token : tokens) {
649649
if (token.token_present)

0 commit comments

Comments
 (0)