summaryrefslogtreecommitdiffstats
path: root/Source/cmExtraCodeLiteGenerator.cxx
diff options
context:
space:
mode:
authorAaron Orenstein <aorenste@fb.com>2017-10-27 05:41:04 (GMT)
committerBrad King <brad.king@kitware.com>2017-11-17 15:25:41 (GMT)
commit4a6348dbbd35c51fabf01d517357129ed9480c85 (patch)
treeb38bcaa7a1416dd90f16a54651ea61cf0cfa1f1c /Source/cmExtraCodeLiteGenerator.cxx
parent1fe9e49bad0ad4f540ceda028106d9af89084946 (diff)
downloadCMake-4a6348dbbd35c51fabf01d517357129ed9480c85.zip
CMake-4a6348dbbd35c51fabf01d517357129ed9480c85.tar.gz
CMake-4a6348dbbd35c51fabf01d517357129ed9480c85.tar.bz2
Performance: Improve efficiency of source file lookup in cmMakefile
This reintroduces the change from commit v3.10.0-rc1~69^2 (Performance: Improve efficiency of source file lookup in cmMakefile, 2017-08-17) with some corrections. The original was rolled back by commit v3.10.0-rc1~52^2~1 (Revert "Performance: ...", 2017-09-25) due to incompatibilities found. The rollback was followed-up by addition of a test for the offending case, and this revision passes the test.
Diffstat (limited to 'Source/cmExtraCodeLiteGenerator.cxx')
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx10
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 5a02d54..383942b 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -198,8 +198,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
std::map<std::string, cmSourceFile*>& cFiles,
std::set<std::string>& otherFiles)
{
- const std::vector<std::string>& srcExts =
- this->GlobalGenerator->GetCMakeInstance()->GetSourceExtensions();
+ auto cm = this->GlobalGenerator->GetCMakeInstance();
std::string projectType;
switch (gt->GetType()) {
@@ -233,12 +232,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
std::string lang = s->GetLanguage();
if (lang == "C" || lang == "CXX") {
std::string const& srcext = s->GetExtension();
- for (std::string const& ext : srcExts) {
- if (srcext == ext) {
- isCFile = true;
- break;
- }
- }
+ isCFile = cm->IsSourceExtension(srcext);
}
// then put it accordingly into one of the two containers