diff --git a/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc b/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc index 2a1d26a83b..da8f7870b1 100644 --- a/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc +++ b/logging/rtc_event_log/encoder/rtc_event_log_encoder_new_format.cc @@ -315,7 +315,7 @@ size_t RemoveNonWhitelistedRtcpBlocks(const rtc::Buffer& packet, template void EncodeRtcpPacket(rtc::ArrayView batch, ProtoType* proto_batch) { - if (batch.size() == 0) { + if (batch.empty()) { return; } @@ -366,7 +366,7 @@ void EncodeRtcpPacket(rtc::ArrayView batch, template void EncodeRtpPacket(const std::vector& batch, ProtoType* proto_batch) { - if (batch.size() == 0) { + if (batch.empty()) { return; } @@ -889,7 +889,7 @@ void RtcEventLogEncoderNewFormat::EncodeAlrState( void RtcEventLogEncoderNewFormat::EncodeAudioNetworkAdaptation( rtc::ArrayView batch, rtclog2::EventStream* event_stream) { - if (batch.size() == 0) + if (batch.empty()) return; // Base event @@ -1041,7 +1041,7 @@ void RtcEventLogEncoderNewFormat::EncodeAudioNetworkAdaptation( void RtcEventLogEncoderNewFormat::EncodeAudioPlayout( rtc::ArrayView batch, rtclog2::EventStream* event_stream) { - if (batch.size() == 0) + if (batch.empty()) return; // Base event @@ -1120,7 +1120,7 @@ void RtcEventLogEncoderNewFormat::EncodeAudioSendStreamConfig( void RtcEventLogEncoderNewFormat::EncodeBweUpdateDelayBased( rtc::ArrayView batch, rtclog2::EventStream* event_stream) { - if (batch.size() == 0) + if (batch.empty()) return; // Base event @@ -1177,7 +1177,7 @@ void RtcEventLogEncoderNewFormat::EncodeBweUpdateDelayBased( void RtcEventLogEncoderNewFormat::EncodeBweUpdateLossBased( rtc::ArrayView batch, rtclog2::EventStream* event_stream) { - if (batch.size() == 0) + if (batch.empty()) return; // Base event diff --git a/logging/rtc_event_log/rtc_event_log2rtp_dump.cc b/logging/rtc_event_log/rtc_event_log2rtp_dump.cc index 62d6bfc6d1..cbe3e6d9d7 100644 --- a/logging/rtc_event_log/rtc_event_log2rtp_dump.cc +++ b/logging/rtc_event_log/rtc_event_log2rtp_dump.cc @@ -195,7 +195,7 @@ int main(int argc, char* argv[]) { webrtc::test::RtpFileWriter::Create( webrtc::test::RtpFileWriter::FileFormat::kRtpDump, output_file)); - if (!rtp_writer.get()) { + if (!rtp_writer) { std::cerr << "Error while opening output file: " << output_file << std::endl; return -1; diff --git a/logging/rtc_event_log/rtc_event_log_impl.cc b/logging/rtc_event_log/rtc_event_log_impl.cc index b356e8b694..1b2e82a1b8 100644 --- a/logging/rtc_event_log/rtc_event_log_impl.cc +++ b/logging/rtc_event_log/rtc_event_log_impl.cc @@ -330,9 +330,9 @@ void RtcEventLogImpl::WriteConfigsAndHistoryToOutput( // This function is used to merge the strings instead of calling the output // object twice with small strings. The function also avoids copying any // strings in the typical case where there are no config events. - if (encoded_configs.size() == 0) { + if (encoded_configs.empty()) { WriteToOutput(encoded_history); // Typical case. - } else if (encoded_history.size() == 0) { + } else if (encoded_history.empty()) { WriteToOutput(encoded_configs); // Very unusual case. } else { WriteToOutput(encoded_configs + encoded_history);