diff options
-rw-r--r-- | talk/app/webrtc/webrtcsdp.cc | 2 | ||||
-rw-r--r-- | webrtc/modules/audio_processing/test/audio_processing_unittest.cc | 2 | ||||
-rw-r--r-- | webrtc/modules/audio_processing/test/audioproc_float.cc | 6 | ||||
-rw-r--r-- | webrtc/modules/audio_processing/transient/transient_suppression_test.cc | 4 | ||||
-rw-r--r-- | webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc | 4 | ||||
-rw-r--r-- | webrtc/modules/video_coding/codecs/tools/video_quality_measurement.cc | 4 | ||||
-rw-r--r-- | webrtc/modules/video_coding/main/test/test_util.cc | 2 | ||||
-rw-r--r-- | webrtc/modules/video_coding/main/test/video_rtp_play.cc | 3 | ||||
-rw-r--r-- | webrtc/test/field_trial.cc | 2 | ||||
-rw-r--r-- | webrtc/tools/agc/agc_test.cc | 2 | ||||
-rw-r--r-- | webrtc/video/end_to_end_tests.cc | 2 | ||||
-rw-r--r-- | webrtc/video/replay.cc | 8 |
12 files changed, 20 insertions, 21 deletions
diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc index 9d647955d1..b6f23ca9d0 100644 --- a/talk/app/webrtc/webrtcsdp.cc +++ b/talk/app/webrtc/webrtcsdp.cc @@ -2192,7 +2192,7 @@ bool ParseMediaDescription(const std::string& message, for (size_t j = 3 ; j < fields.size(); ++j) { // TODO(wu): Remove when below bug is fixed. // https://bugzilla.mozilla.org/show_bug.cgi?id=996329 - if (fields[j] == "" && j == fields.size() - 1) { + if (fields[j].empty() && j == fields.size() - 1) { continue; } diff --git a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc index c7c45f7eeb..291035a012 100644 --- a/webrtc/modules/audio_processing/test/audio_processing_unittest.cc +++ b/webrtc/modules/audio_processing/test/audio_processing_unittest.cc @@ -269,7 +269,7 @@ std::string OutputFilePath(std::string name, ss << output_rate / 1000 << "_pcm"; std::string filename = ss.str(); - if (temp_filenames[filename] == "") + if (temp_filenames[filename].empty()) temp_filenames[filename] = test::TempFilename(test::OutputPath(), filename); return temp_filenames[filename]; } diff --git a/webrtc/modules/audio_processing/test/audioproc_float.cc b/webrtc/modules/audio_processing/test/audioproc_float.cc index 381d7fd2b6..dac43629cf 100644 --- a/webrtc/modules/audio_processing/test/audioproc_float.cc +++ b/webrtc/modules/audio_processing/test/audioproc_float.cc @@ -64,12 +64,12 @@ int main(int argc, char* argv[]) { google::SetUsageMessage(kUsage); google::ParseCommandLineFlags(&argc, &argv, true); - if (!((FLAGS_i == "") ^ (FLAGS_dump == ""))) { + if (!((FLAGS_i.empty()) ^ (FLAGS_dump.empty()))) { fprintf(stderr, "An input file must be specified with either -i or -dump.\n"); return 1; } - if (FLAGS_dump != "") { + if (!FLAGS_dump.empty()) { fprintf(stderr, "FIXME: the -dump option is not yet implemented.\n"); return 1; } @@ -96,7 +96,7 @@ int main(int argc, char* argv[]) { } rtc::scoped_ptr<AudioProcessing> ap(AudioProcessing::Create(config)); - if (FLAGS_dump != "") { + if (!FLAGS_dump.empty()) { CHECK_EQ(kNoErr, ap->echo_cancellation()->Enable(FLAGS_aec || FLAGS_all)); } else if (FLAGS_aec) { fprintf(stderr, "-aec requires a -dump file.\n"); diff --git a/webrtc/modules/audio_processing/transient/transient_suppression_test.cc b/webrtc/modules/audio_processing/transient/transient_suppression_test.cc index fdc5686763..506abaf203 100644 --- a/webrtc/modules/audio_processing/transient/transient_suppression_test.cc +++ b/webrtc/modules/audio_processing/transient/transient_suppression_test.cc @@ -150,13 +150,13 @@ void void_main() { // Prepare the detection file. FILE* detection_file = NULL; - if (FLAGS_detection_file_name != "") { + if (!FLAGS_detection_file_name.empty()) { detection_file = fopen(FLAGS_detection_file_name.c_str(), "rb"); } // Prepare the reference file. FILE* reference_file = NULL; - if (FLAGS_reference_file_name != "") { + if (!FLAGS_reference_file_name.empty()) { reference_file = fopen(FLAGS_reference_file_name.c_str(), "rb"); } diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc index 319a97bfca..de13023b26 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.cc @@ -116,9 +116,9 @@ Logging::State::State(const std::string& tag, int64_t timestamp_ms, } void Logging::State::MergePrevious(const State& previous) { - if (tag == "") { + if (tag.empty()) { tag = previous.tag; - } else if (previous.tag != "") { + } else if (!previous.tag.empty()) { tag = previous.tag + "_" + tag; } timestamp_ms = std::max(previous.timestamp_ms, timestamp_ms); diff --git a/webrtc/modules/video_coding/codecs/tools/video_quality_measurement.cc b/webrtc/modules/video_coding/codecs/tools/video_quality_measurement.cc index ced92bce24..f6eee39f3b 100644 --- a/webrtc/modules/video_coding/codecs/tools/video_quality_measurement.cc +++ b/webrtc/modules/video_coding/codecs/tools/video_quality_measurement.cc @@ -111,7 +111,7 @@ int Log(const char *format, ...) { // Returns 0 if everything is OK, otherwise an exit code. int HandleCommandLineFlags(webrtc::test::TestConfig* config) { // Validate the mandatory flags: - if (FLAGS_input_filename == "" || FLAGS_width == -1 || FLAGS_height == -1) { + if (FLAGS_input_filename.empty() || FLAGS_width == -1 || FLAGS_height == -1) { printf("%s\n", google::ProgramUsage()); return 1; } @@ -140,7 +140,7 @@ int HandleCommandLineFlags(webrtc::test::TestConfig* config) { config->output_dir = FLAGS_output_dir; // Manufacture an output filename if none was given. - if (FLAGS_output_filename == "") { + if (FLAGS_output_filename.empty()) { // Cut out the filename without extension from the given input file // (which may include a path) int startIndex = FLAGS_input_filename.find_last_of("/") + 1; diff --git a/webrtc/modules/video_coding/main/test/test_util.cc b/webrtc/modules/video_coding/main/test/test_util.cc index ce71cbb49d..cd858da288 100644 --- a/webrtc/modules/video_coding/main/test/test_util.cc +++ b/webrtc/modules/video_coding/main/test/test_util.cc @@ -73,7 +73,7 @@ FileOutputFrameReceiver::FileOutputFrameReceiver( count_(0) { std::string basename; std::string extension; - if (base_out_filename == "") { + if (base_out_filename.empty()) { basename = webrtc::test::OutputPath() + "rtp_decoded"; extension = "yuv"; } else { diff --git a/webrtc/modules/video_coding/main/test/video_rtp_play.cc b/webrtc/modules/video_coding/main/test/video_rtp_play.cc index c1bc02fbed..256f508327 100644 --- a/webrtc/modules/video_coding/main/test/video_rtp_play.cc +++ b/webrtc/modules/video_coding/main/test/video_rtp_play.cc @@ -44,9 +44,8 @@ int RtpPlay(const CmdArgs& args) { kDefaultVp8PayloadType, "VP8", webrtc::kVideoCodecVP8)); std::string output_file = args.outputFile; - if (output_file == "") { + if (output_file.empty()) output_file = webrtc::test::OutputPath() + "RtpPlay_decoded.yuv"; - } webrtc::SimulatedClock clock(0); webrtc::rtpplayer::VcmPayloadSinkFactory factory(output_file, &clock, diff --git a/webrtc/test/field_trial.cc b/webrtc/test/field_trial.cc index 92aa6b0815..05ca052a57 100644 --- a/webrtc/test/field_trial.cc +++ b/webrtc/test/field_trial.cc @@ -49,7 +49,7 @@ void InitFieldTrialsFromString(const std::string& trials_string) { assert(field_trials_initiated_ == false); field_trials_initiated_ = true; - if (trials_string == "") + if (trials_string.empty()) return; size_t next_item = 0; diff --git a/webrtc/tools/agc/agc_test.cc b/webrtc/tools/agc/agc_test.cc index a651cb168e..e8c4eb8884 100644 --- a/webrtc/tools/agc/agc_test.cc +++ b/webrtc/tools/agc/agc_test.cc @@ -91,7 +91,7 @@ void RunAgc() { ASSERT_TRUE(out_file != NULL); int gain_map[256]; - if (FLAGS_gain_file != "") { + if (!FLAGS_gain_file.empty()) { FILE* gain_file = fopen(FLAGS_gain_file.c_str(), "rt"); ASSERT_TRUE(gain_file != NULL); ReadGainMapFromFile(gain_file, FLAGS_gain_offset, gain_map); diff --git a/webrtc/video/end_to_end_tests.cc b/webrtc/video/end_to_end_tests.cc index dd9650db05..82fbe3ae52 100644 --- a/webrtc/video/end_to_end_tests.cc +++ b/webrtc/video/end_to_end_tests.cc @@ -2001,7 +2001,7 @@ TEST_F(EndToEndTest, GetStats) { stats.frame_counts.key_frames != 0 || stats.frame_counts.delta_frames != 0; - receive_stats_filled_["CName"] |= stats.c_name != ""; + receive_stats_filled_["CName"] |= !stats.c_name.empty(); receive_stats_filled_["RtcpPacketTypeCount"] |= stats.rtcp_packet_type_counts.fir_packets != 0 || diff --git a/webrtc/video/replay.cc b/webrtc/video/replay.cc index 4b5aa0fb5f..fa61257bbf 100644 --- a/webrtc/video/replay.cc +++ b/webrtc/video/replay.cc @@ -106,7 +106,7 @@ static const bool timestamp_offset_dummy = // Flag for rtpdump input file. bool ValidateInputFilenameNotEmpty(const char* flagname, const std::string& string) { - return string != ""; + return !string.empty(); } DEFINE_string(input_file, "", "input file"); @@ -156,7 +156,7 @@ class FileRenderPassthrough : public VideoRenderer { int time_to_render_ms) override { if (renderer_ != nullptr) renderer_->RenderFrame(video_frame, time_to_render_ms); - if (basename_ == "") + if (basename_.empty()) return; if (last_width_ != video_frame.width() || last_height_ != video_frame.height()) { @@ -241,13 +241,13 @@ void RtpReplay() { encoder_settings.payload_type = flags::PayloadType(); VideoReceiveStream::Decoder decoder; rtc::scoped_ptr<DecoderBitstreamFileWriter> bitstream_writer; - if (flags::DecoderBitstreamFilename() != "") { + if (!flags::DecoderBitstreamFilename().empty()) { bitstream_writer.reset(new DecoderBitstreamFileWriter( flags::DecoderBitstreamFilename().c_str())); receive_config.pre_decode_callback = bitstream_writer.get(); } decoder = test::CreateMatchingDecoder(encoder_settings); - if (flags::DecoderBitstreamFilename() != "") { + if (!flags::DecoderBitstreamFilename().empty()) { // Replace with a null decoder if we're writing the bitstream to a file // instead. delete decoder.decoder; |