mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user