mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
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: https://github.com/nodejs/node/pull/48561 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
This commit is contained in:
1 parent
900ae1bda7
commit
546797f2b1
1 file changed
+1
-1
+1
-1
@@ -643,7 +643,7 @@ void Session::Destroy() {
|
||||
endpoint_->DisassociateCID(config_.dcid);
|
||||
endpoint_->DisassociateCID(config_.preferred_address_cid);
|
||||
|
||||
for (auto cid : cids) endpoint_->DisassociateCID(CID(&cid));
|
||||
for (const auto& cid : cids) endpoint_->DisassociateCID(CID(&cid));
|
||||
|
||||
for (const auto& token : tokens) {
|
||||
if (token.token_present)
|
||||
|
||||
Reference in new issue
Block a user