ClangTidy fixes for logging/

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: I2ea59dc66230182bee6ae7a0925aed0fe9ef823c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127643
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27133}
This commit is contained in:
Benjamin Wright 2019-03-13 17:51:59 -07:00 committed by Commit Bot
parent 27897662d2
commit f1c9e21366
3 changed files with 9 additions and 9 deletions

View File

@ -315,7 +315,7 @@ size_t RemoveNonWhitelistedRtcpBlocks(const rtc::Buffer& packet,
template <typename EventType, typename ProtoType>
void EncodeRtcpPacket(rtc::ArrayView<const EventType*> batch,
ProtoType* proto_batch) {
if (batch.size() == 0) {
if (batch.empty()) {
return;
}
@ -366,7 +366,7 @@ void EncodeRtcpPacket(rtc::ArrayView<const EventType*> batch,
template <typename EventType, typename ProtoType>
void EncodeRtpPacket(const std::vector<const EventType*>& batch,
ProtoType* proto_batch) {
if (batch.size() == 0) {
if (batch.empty()) {
return;
}
@ -889,7 +889,7 @@ void RtcEventLogEncoderNewFormat::EncodeAlrState(
void RtcEventLogEncoderNewFormat::EncodeAudioNetworkAdaptation(
rtc::ArrayView<const RtcEventAudioNetworkAdaptation*> 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<const RtcEventAudioPlayout*> 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<const RtcEventBweUpdateDelayBased*> 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<const RtcEventBweUpdateLossBased*> batch,
rtclog2::EventStream* event_stream) {
if (batch.size() == 0)
if (batch.empty())
return;
// Base event

View File

@ -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;

View File

@ -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);