Remove empty-string comparisons.

Use .empty() and !.empty() in favor of == "" or != "".

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1228913003

Cr-Commit-Position: refs/heads/master@{#9559}
diff --git a/talk/app/webrtc/webrtcsdp.cc b/talk/app/webrtc/webrtcsdp.cc
index 9d64795..b6f23ca 100644
--- a/talk/app/webrtc/webrtcsdp.cc
+++ b/talk/app/webrtc/webrtcsdp.cc
@@ -2192,7 +2192,7 @@
       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 c7c45f7..291035a 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 @@
   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 381d7fd..dac4362 100644
--- a/webrtc/modules/audio_processing/test/audioproc_float.cc
+++ b/webrtc/modules/audio_processing/test/audioproc_float.cc
@@ -64,12 +64,12 @@
   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 @@
   }
 
   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 fdc5686..506abaf 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 @@
 
   // 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 319a97b..de13023 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 @@
 }
 
 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 ced92bc..f6eee39 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 @@
 // 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 @@
   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 ce71cbb..cd858da 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 @@
       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 c1bc02f..256f508 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 @@
       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 92aa6b0..05ca052 100644
--- a/webrtc/test/field_trial.cc
+++ b/webrtc/test/field_trial.cc
@@ -49,7 +49,7 @@
   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 a651cb1..e8c4eb8 100644
--- a/webrtc/tools/agc/agc_test.cc
+++ b/webrtc/tools/agc/agc_test.cc
@@ -91,7 +91,7 @@
   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 dd9650d..82fbe3a 100644
--- a/webrtc/video/end_to_end_tests.cc
+++ b/webrtc/video/end_to_end_tests.cc
@@ -2001,7 +2001,7 @@
             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 4b5aa0f..fa61257 100644
--- a/webrtc/video/replay.cc
+++ b/webrtc/video/replay.cc
@@ -106,7 +106,7 @@
 // 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 @@
                    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 @@
   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;