From 41f9f2cc5796fdad5a55962d84bf9befb79d456d Mon Sep 17 00:00:00 2001 From: Benjamin Wright Date: Wed, 13 Mar 2019 18:03:29 -0700 Subject: [PATCH] ClangTidy fixes for call/ These are manual edits please verify there are no typos. Feel free to auto-submit if there are no issues. Bug: webrtc:10410 Change-Id: I08ff36bd689fa7c3716c8e7017bd571cc9f09f35 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127642 Reviewed-by: Niels Moller Reviewed-by: Fredrik Solenberg Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#27125} --- call/bitrate_allocator_unittest.cc | 1 - call/bitrate_estimator_tests.cc | 2 +- call/call.cc | 8 ++++---- call/call_factory.cc | 2 +- call/call_perf_tests.cc | 2 +- call/fake_network_pipe_unittest.cc | 3 --- call/rtp_transport_controller_send_interface.h | 1 - call/rtp_video_sender_unittest.cc | 3 --- 8 files changed, 7 insertions(+), 15 deletions(-) diff --git a/call/bitrate_allocator_unittest.cc b/call/bitrate_allocator_unittest.cc index 4441326db9..56344ac0b9 100644 --- a/call/bitrate_allocator_unittest.cc +++ b/call/bitrate_allocator_unittest.cc @@ -19,7 +19,6 @@ using ::testing::_; using ::testing::NiceMock; -using ::testing::StrictMock; namespace webrtc { // Emulating old interface for test suite compatibility. diff --git a/call/bitrate_estimator_tests.cc b/call/bitrate_estimator_tests.cc index 017ceccf32..87e37dff2c 100644 --- a/call/bitrate_estimator_tests.cc +++ b/call/bitrate_estimator_tests.cc @@ -66,7 +66,7 @@ class LogObserver { num_popped++; EXPECT_TRUE(a.find(b) != std::string::npos) << a << " != " << b; } - if (expected_log_lines_.size() <= 0) { + if (expected_log_lines_.empty()) { if (num_popped > 0) { done_.Set(); } diff --git a/call/call.cc b/call/call.cc index a693f7f8c4..28091a8b34 100644 --- a/call/call.cc +++ b/call/call.cc @@ -1092,16 +1092,16 @@ void Call::UpdateAggregateNetworkState() { bool have_video = false; { ReadLockScoped read_lock(*send_crit_); - if (audio_send_ssrcs_.size() > 0) + if (!audio_send_ssrcs_.empty()) have_audio = true; - if (video_send_ssrcs_.size() > 0) + if (!video_send_ssrcs_.empty()) have_video = true; } { ReadLockScoped read_lock(*receive_crit_); - if (audio_receive_streams_.size() > 0) + if (!audio_receive_streams_.empty()) have_audio = true; - if (video_receive_streams_.size() > 0) + if (!video_receive_streams_.empty()) have_video = true; } diff --git a/call/call_factory.cc b/call/call_factory.cc index 309063d085..e6175969f0 100644 --- a/call/call_factory.cc +++ b/call/call_factory.cc @@ -25,7 +25,7 @@ namespace webrtc { namespace { bool ParseConfigParam(std::string exp_name, int* field) { std::string group = field_trial::FindFullName(exp_name); - if (group == "") + if (group.empty()) return false; return (sscanf(group.c_str(), "%d", field) == 1); diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc index 7325c15449..f322137a7f 100644 --- a/call/call_perf_tests.cc +++ b/call/call_perf_tests.cc @@ -637,7 +637,7 @@ void CallPerfTest::TestMinTransmitBitrate(bool pad_to_min_bitrate) { // TODO(holmer): Run this with a timer instead of once per packet. Action OnSendRtp(const uint8_t* packet, size_t length) override { VideoSendStream::Stats stats = send_stream_->GetStats(); - if (stats.substreams.size() > 0) { + if (!stats.substreams.empty()) { RTC_DCHECK_EQ(1, stats.substreams.size()); int bitrate_kbps = stats.substreams.begin()->second.total_bitrate_bps / 1000; diff --git a/call/fake_network_pipe_unittest.cc b/call/fake_network_pipe_unittest.cc index df5ba1b7bd..da84470cf6 100644 --- a/call/fake_network_pipe_unittest.cc +++ b/call/fake_network_pipe_unittest.cc @@ -20,9 +20,6 @@ #include "test/gtest.h" using ::testing::_; -using ::testing::AnyNumber; -using ::testing::Invoke; -using ::testing::Return; namespace webrtc { diff --git a/call/rtp_transport_controller_send_interface.h b/call/rtp_transport_controller_send_interface.h index 18a6326d4c..d56403542a 100644 --- a/call/rtp_transport_controller_send_interface.h +++ b/call/rtp_transport_controller_send_interface.h @@ -35,7 +35,6 @@ class TaskQueue; } // namespace rtc namespace webrtc { -class CallStats; class CallStatsObserver; class FrameEncryptorInterface; class TargetTransferRateObserver; diff --git a/call/rtp_video_sender_unittest.cc b/call/rtp_video_sender_unittest.cc index a387932311..6b4ef7a672 100644 --- a/call/rtp_video_sender_unittest.cc +++ b/call/rtp_video_sender_unittest.cc @@ -27,10 +27,7 @@ #include "video/send_statistics_proxy.h" using ::testing::_; -using ::testing::AnyNumber; -using ::testing::Invoke; using ::testing::NiceMock; -using ::testing::Return; using ::testing::SaveArg; using ::testing::Unused;