diff options
author | pbos <pbos@webrtc.org> | 2015-07-09 07:48:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-09 14:48:27 +0000 |
commit | bb36fdf95f9667fb1f3fbf3073bd15007681322c (patch) | |
tree | b4c0d85b61cfddf1f729908157232f7f86f6ba5d /webrtc/modules | |
parent | 3b1e647b6a6f74d8e4392e012fe2262b3d2c4334 (diff) | |
download | webrtc-bb36fdf95f9667fb1f3fbf3073bd15007681322c.tar.gz |
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}
Diffstat (limited to 'webrtc/modules')
7 files changed, 12 insertions, 13 deletions
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, |