summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortran.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2020-04-08 15:51:36 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2020-04-13 15:26:02 (GMT)
commitf2a33107be2d7d701708506c4c3054799d941bd6 (patch)
tree5fe7cc0705c425c368c293ff6dab6642ff1745ed /Source/cmDependsFortran.cxx
parent4e9e7c713e01284d48fff8f3f18b3ffb08b6eaf9 (diff)
downloadCMake-f2a33107be2d7d701708506c4c3054799d941bd6.zip
CMake-f2a33107be2d7d701708506c4c3054799d941bd6.tar.gz
CMake-f2a33107be2d7d701708506c4c3054799d941bd6.tar.bz2
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/cmDependsFortran.cxx')
-rw-r--r--Source/cmDependsFortran.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 666306c..c45cd1c 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -29,12 +29,10 @@ static void cmFortranModuleAppendUpperLower(std::string const& mod,
std::string& mod_lower)
{
std::string::size_type ext_len = 0;
- if (cmHasLiteralSuffix(mod, ".mod")) {
+ if (cmHasLiteralSuffix(mod, ".mod") || cmHasLiteralSuffix(mod, ".sub")) {
ext_len = 4;
} else if (cmHasLiteralSuffix(mod, ".smod")) {
ext_len = 5;
- } else if (cmHasLiteralSuffix(mod, ".sub")) {
- ext_len = 4;
}
std::string const& name = mod.substr(0, mod.size() - ext_len);
std::string const& ext = mod.substr(mod.size() - ext_len);