summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2022-07-05 01:14:18 (GMT)
committerBrad King <brad.king@kitware.com>2022-08-02 13:46:52 (GMT)
commit2f69c0233cec7dc64053813c20cc83d306247594 (patch)
treefb015fbf42f24e8749e1c95455139826f84b4a3f /Source/cmFindPackageCommand.cxx
parent076a4b44b0b338eac767c9c96895afdaf7321486 (diff)
downloadCMake-2f69c0233cec7dc64053813c20cc83d306247594.zip
CMake-2f69c0233cec7dc64053813c20cc83d306247594.tar.gz
CMake-2f69c0233cec7dc64053813c20cc83d306247594.tar.bz2
cmFindPackageCommand: Optimize the last calls to `TryGeneratedPaths`
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx24
1 files changed, 6 insertions, 18 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index f10b097..f260ec7 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -2578,12 +2578,8 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
}
// PREFIX/(Foo|foo|FOO).*/(lib/ARCH|lib*|share)/(Foo|foo|FOO).*/(cmake|CMake)/
- if (TryGeneratedPaths(searchFn, prefix, firstPkgDirGen, cmnGen,
- secondPkgDirGen, iCMakeGen)) {
- return true;
- }
-
- return false;
+ return TryGeneratedPaths(searchFn, prefix, firstPkgDirGen, cmnGen,
+ secondPkgDirGen, iCMakeGen);
}
bool cmFindPackageCommand::SearchFrameworkPrefix(std::string const& prefix_in)
@@ -2621,11 +2617,7 @@ bool cmFindPackageCommand::SearchFrameworkPrefix(std::string const& prefix_in)
}
// <prefix>/Foo.framework/Versions/*/Resources/CMake/
- if (TryGeneratedPaths(searchFn, prefix, fwGen, vGen, grGen, iCMakeGen)) {
- return true;
- }
-
- return false;
+ return TryGeneratedPaths(searchFn, prefix, fwGen, vGen, grGen, iCMakeGen);
}
bool cmFindPackageCommand::SearchAppBundlePrefix(std::string const& prefix_in)
@@ -2649,13 +2641,9 @@ bool cmFindPackageCommand::SearchAppBundlePrefix(std::string const& prefix_in)
}
// <prefix>/Foo.app/Contents/Resources/CMake
- if (TryGeneratedPaths(
- searchFn, prefix, appGen, crGen,
- cmCaseInsensitiveDirectoryListGenerator{ "cmake"_s })) {
- return true;
- }
-
- return false;
+ return TryGeneratedPaths(
+ searchFn, prefix, appGen, crGen,
+ cmCaseInsensitiveDirectoryListGenerator{ "cmake"_s });
}
// TODO: Debug cmsys::Glob double slash problem.