Apply performance-for-range-copy fixes.
This CL has been generated running https://clang.llvm.org/extra/clang-tidy/checks/performance-for-range-copy.html. Bug: None Change-Id: Ia9f6c91776fc8b3ab28fba87ba8ce112f87d5cf0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/172805 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/master@{#30996}
This commit is contained in:
committed by
Commit Bot
parent
eb03d286df
commit
16d0d371d5
@ -830,7 +830,7 @@ void WebRtcVideoChannel::RequestEncoderSwitch(
|
||||
return;
|
||||
}
|
||||
|
||||
for (VideoCodecSettings codec_setting : negotiated_codecs_) {
|
||||
for (const VideoCodecSettings& codec_setting : negotiated_codecs_) {
|
||||
if (codec_setting.codec.name == conf.codec_name) {
|
||||
if (conf.param) {
|
||||
auto it = codec_setting.codec.params.find(*conf.param);
|
||||
|
||||
@ -222,7 +222,7 @@ void DataChannelController::OnTransportChanged(
|
||||
data_channel_transport_invoker_->AsyncInvoke<void>(
|
||||
RTC_FROM_HERE, signaling_thread(), [this] {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread());
|
||||
for (auto channel : sctp_data_channels_) {
|
||||
for (const auto& channel : sctp_data_channels_) {
|
||||
channel->OnTransportChannelCreated();
|
||||
}
|
||||
});
|
||||
|
||||
@ -1456,7 +1456,7 @@ void JsepTransportController::OnTransportStateChanged_n(
|
||||
void JsepTransportController::OnDataChannelTransportNegotiated_n(
|
||||
cricket::JsepTransport* transport,
|
||||
DataChannelTransportInterface* data_channel_transport) {
|
||||
for (auto it : mid_to_transport_) {
|
||||
for (const auto& it : mid_to_transport_) {
|
||||
if (it.second == transport) {
|
||||
config_.transport_observer->OnTransportChanged(
|
||||
it.first, transport->rtp_transport(), transport->RtpDtlsTransport(),
|
||||
|
||||
@ -403,7 +403,7 @@ void AndroidNetworkMonitor::SetNetworkInfos(
|
||||
network_info_by_handle_.clear();
|
||||
RTC_LOG(LS_INFO) << "Android network monitor found " << network_infos.size()
|
||||
<< " networks";
|
||||
for (NetworkInformation network : network_infos) {
|
||||
for (const NetworkInformation& network : network_infos) {
|
||||
OnNetworkConnected_w(network);
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ using VideoCodecConfig = PeerConnectionE2EQualityTestFixture::VideoCodecConfig;
|
||||
std::string CodecRequiredParamsToString(
|
||||
const std::map<std::string, std::string>& codec_required_params) {
|
||||
rtc::StringBuilder out;
|
||||
for (auto entry : codec_required_params) {
|
||||
for (const auto& entry : codec_required_params) {
|
||||
out << entry.first << "=" << entry.second << ";";
|
||||
}
|
||||
return out.str();
|
||||
@ -47,7 +47,7 @@ std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
|
||||
RTC_LOG(INFO) << "Codec: " << codec.name;
|
||||
if (!codec.parameters.empty()) {
|
||||
RTC_LOG(INFO) << "Params:";
|
||||
for (auto param : codec.parameters) {
|
||||
for (const auto& param : codec.parameters) {
|
||||
RTC_LOG(INFO) << " " << param.first << "=" << param.second;
|
||||
}
|
||||
}
|
||||
@ -62,7 +62,7 @@ std::vector<RtpCodecCapability> FilterVideoCodecCapabilities(
|
||||
continue;
|
||||
}
|
||||
bool parameters_matched = true;
|
||||
for (auto item : codec_request.required_params) {
|
||||
for (const auto& item : codec_request.required_params) {
|
||||
auto it = codec.parameters.find(item.first);
|
||||
if (it == codec.parameters.end()) {
|
||||
parameters_matched = false;
|
||||
@ -131,7 +131,7 @@ void SignalingInterceptor::FillSimulcastContext(
|
||||
media_desc->set_simulcast_description(simulcast_description);
|
||||
|
||||
info.simulcast_description = media_desc->simulcast_description();
|
||||
for (auto extension : media_desc->rtp_header_extensions()) {
|
||||
for (const auto& extension : media_desc->rtp_header_extensions()) {
|
||||
if (extension.uri == RtpExtension::kMidUri) {
|
||||
info.mid_extension = extension;
|
||||
} else if (extension.uri == RtpExtension::kRidUri) {
|
||||
@ -443,7 +443,7 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp8Answer(
|
||||
// but it have to have receive layers instead of send. So we need to put
|
||||
// send layers from offer to receive layers in answer.
|
||||
cricket::SimulcastDescription simulcast_description;
|
||||
for (auto layer : info.simulcast_description.send_layers()) {
|
||||
for (const auto& layer : info.simulcast_description.send_layers()) {
|
||||
simulcast_description.receive_layers().AddLayerWithAlternatives(layer);
|
||||
}
|
||||
media_desc->set_simulcast_description(simulcast_description);
|
||||
|
||||
Reference in New Issue
Block a user