summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-07-04 02:43:55 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2022-07-11 13:14:02 (GMT)
commitef62f213f8c24d58c28ee1812887fc77667ead47 (patch)
tree8f084b8acc01788b54ad4a5fcf55bd6028f99d6e
parent468d04ef1444360cc95f685783bab9dc0e7ac43a (diff)
downloadCMake-ef62f213f8c24d58c28ee1812887fc77667ead47.zip
CMake-ef62f213f8c24d58c28ee1812887fc77667ead47.tar.gz
CMake-ef62f213f8c24d58c28ee1812887fc77667ead47.tar.bz2
cmFindPackageCommand: Drop dead code
The `cmFindPackageFileList` instances always constructed w/ the only parameter. The boolean flag is always `true` (default value). Also, `cmFindPackageCommand::InitialPass` adds an empty string to the `cmFindPackageCommand::SearchPathSuffixes` vector. Meaning that `cmFindPackageCommand::CheckDirectory()` gonna be called for the suffix-less path, so `cmFindPackageFileList::Visit` may call only `cmFindPackageCommand::SearchDirectory` and get the same result.
-rw-r--r--Source/cmFindPackageCommand.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index afc63a5..f955653 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -2220,23 +2220,17 @@ bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
class cmFindPackageFileList : public cmFileList
{
public:
- cmFindPackageFileList(cmFindPackageCommand* const fpc,
- bool const use_suffixes = true)
+ cmFindPackageFileList(cmFindPackageCommand* const fpc)
: FPC(fpc)
- , UseSuffixes(use_suffixes)
{
}
private:
bool Visit(std::string const& fullPath) override
{
- if (this->UseSuffixes) {
- return this->FPC->SearchDirectory(fullPath);
- }
- return this->FPC->CheckDirectory(fullPath);
+ return this->FPC->SearchDirectory(fullPath);
}
cmFindPackageCommand* const FPC;
- bool const UseSuffixes;
};
namespace {