summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-16 20:45:24 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-09-16 20:45:24 (GMT)
commit516f8edb2e061749c56b6f9a58332fbf59e45a1a (patch)
tree82ebe3f38b5248ef0b78586019ac1dca44ce2370 /Source/cmFindPackageCommand.cxx
parentd9f5d3c50fe376423382d6445f7fb2906a43469e (diff)
downloadCMake-516f8edb2e061749c56b6f9a58332fbf59e45a1a.zip
CMake-516f8edb2e061749c56b6f9a58332fbf59e45a1a.tar.gz
CMake-516f8edb2e061749c56b6f9a58332fbf59e45a1a.tar.bz2
Avoid else after return
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 405dce3..8b7bee2 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1308,18 +1308,16 @@ bool cmFindPackageCommand::CheckPackageRegistryEntry(const std::string& fname,
outPaths.AddPath(fname);
}
return true;
- } else {
- // The path does not exist. Assume the stream content is
- // associated with an old package that no longer exists, and
- // delete it to keep the package registry clean.
- return false;
}
- } else {
- // The first line in the stream is not the full path to a file or
- // directory. Assume the stream content was created by a future
- // version of CMake that uses a different format, and leave it.
- return true;
+ // The path does not exist. Assume the stream content is
+ // associated with an old package that no longer exists, and
+ // delete it to keep the package registry clean.
+ return false;
}
+ // The first line in the stream is not the full path to a file or
+ // directory. Assume the stream content was created by a future
+ // version of CMake that uses a different format, and leave it.
+ return true;
}
void cmFindPackageCommand::FillPrefixesCMakeSystemVariable()
@@ -1628,9 +1626,8 @@ private:
{
if (this->UseSuffixes) {
return this->FPC->SearchDirectory(fullPath);
- } else {
- return this->FPC->CheckDirectory(fullPath);
}
+ return this->FPC->CheckDirectory(fullPath);
}
cmFindPackageCommand* FPC;
bool UseSuffixes;
@@ -1653,9 +1650,8 @@ bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
{
if (this->Next.get()) {
return this->Next->Search(fullPath + "/", listing);
- } else {
- return listing.Visit(fullPath + "/");
}
+ return listing.Visit(fullPath + "/");
}
class cmFileListGeneratorFixed : public cmFileListGeneratorBase