summaryrefslogtreecommitdiff
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2020-04-08 11:51:36 -0400
committerBen Boeckel <ben.boeckel@kitware.com>2020-04-13 11:26:02 -0400
commitf2a33107be2d7d701708506c4c3054799d941bd6 (patch)
tree5fe7cc0705c425c368c293ff6dab6642ff1745ed /Source/cmCTest.cxx
parent4e9e7c713e01284d48fff8f3f18b3ffb08b6eaf9 (diff)
downloadcmake-f2a33107be2d7d701708506c4c3054799d941bd6.tar.gz
clang-tidy: address bugprone-branch-clone lints
Arguably, many of these are bugs in `clang-tidy`. An if/else tree with other conditionals between cloned blocks may be relying on the intermediate logic to fall out of the case and inverting this logic may be non-trivial. See: https://bugs.llvm.org/show_bug.cgi?id=44165
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index c5505f97fe..35a89525ab 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1941,13 +1941,11 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
else if (this->CheckArgument(arg, "--debug"_s)) {
this->Impl->Debug = true;
this->Impl->ShowLineNumbers = true;
- } else if (this->CheckArgument(arg, "--group"_s) && i < args.size() - 1) {
- i++;
- this->Impl->SpecificGroup = args[i];
- }
- // This is an undocumented / deprecated option.
- // "Track" has been renamed to "Group".
- else if (this->CheckArgument(arg, "--track"_s) && i < args.size() - 1) {
+ } else if ((this->CheckArgument(arg, "--group"_s) ||
+ // This is an undocumented / deprecated option.
+ // "Track" has been renamed to "Group".
+ this->CheckArgument(arg, "--track"_s)) &&
+ i < args.size() - 1) {
i++;
this->Impl->SpecificGroup = args[i];
} else if (this->CheckArgument(arg, "--show-line-numbers"_s)) {