mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00: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:
parent
900ae1bda7
commit
546797f2b1
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user