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:
pbos
2015-07-09 07:48:14 -07:00
committed by Commit bot
parent 3b1e647b6a
commit bb36fdf95f
12 changed files with 20 additions and 21 deletions

View File

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

View File

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

View File

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