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}
This commit is contained in:
@ -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];
|
||||
}
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user