Skip to content

Commit

Permalink
Simplify IsFlag check logic (#2209)
Browse files Browse the repository at this point in the history
### Issues:
Resolves P194739376

### Description of changes: 
There was some logically dead code that was unnecessary and would never
be reached.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license and the ISC license.
  • Loading branch information
skmcgrail authored Feb 19, 2025
1 parent a5eff8e commit 82a16b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tool/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "internal.h"

bool IsFlag(const std::string& arg) {
return arg.length() > 1 && (arg[0] == '-' || (arg.length() > 2 && arg[0] == '-' && arg[1] == '-'));
return arg.length() > 1 && arg[0] == '-';
}

bool ParseKeyValueArguments(args_map_t &out_args,
Expand Down

0 comments on commit 82a16b6

Please sign in to comment.