Commit 295bc21a authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Remove variable shadowing in blink/modules/peerconnection

In an effort to reduce or even ban variable shadowing, this renames
a variable to avoid such shadowing. I'm interested in prohibiting
shadowing because I think it might prevent potential jumbo problems.

The warning this avoids is:
third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc:1200:20: error: declaration shadows a local variable [-Werror,-Wshadow]
  for (auto const& transport_iterator : dtls_transports_by_mid_) {
                   ^
third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc:1187:8: note: previous declaration is here
  auto transport_iterator = dtls_transports_by_mid_.find(mid);
       ^

Bug: 923510
Change-Id: Ia9e1734c1bd1aa42bf4b13f6d2b43fe28b6ed511
Reviewed-on: https://chromium-review.googlesource.com/c/1478872
Commit-Queue: Daniel Bratell <bratell@opera.com>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Daniel Bratell <bratell@opera.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633746}
parent 889887e8
......@@ -1184,15 +1184,15 @@ RTCDtlsTransport* RTCPeerConnection::LookupDtlsTransportByMid(String mid) {
return nullptr;
// Check for previously created RTCDtlsTransport objects referencing
// this transport.
auto transport_iterator = dtls_transports_by_mid_.find(mid);
if (transport_iterator != dtls_transports_by_mid_.end()) {
if (transport_iterator->value->native_transport() !=
auto transport_lookup_result = dtls_transports_by_mid_.find(mid);
if (transport_lookup_result != dtls_transports_by_mid_.end()) {
if (transport_lookup_result->value->native_transport() !=
native_transport.get()) {
// The mid's transport has changed. Erase the reference to
// the old transport, and continue.
dtls_transports_by_mid_.erase(transport_iterator);
dtls_transports_by_mid_.erase(transport_lookup_result);
} else {
return transport_iterator->value;
return transport_lookup_result->value;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment