소스 검색

speedup: Cache strings for comparisons

Ben Boeckel 11 년 전
부모
커밋
caaad35759
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 1
      Source/cmExtraCodeBlocksGenerator.cxx
  2. 2 1
      Source/cmExtraCodeLiteGenerator.cxx

+ 2 - 1
Source/cmExtraCodeBlocksGenerator.cxx

@@ -414,12 +414,13 @@ void cmExtraCodeBlocksGenerator
             std::string lang = (*si)->GetLanguage();
             if (lang == "C" || lang == "CXX")
               {
+              std::string srcext = (*si)->GetExtension();
               for(std::vector<std::string>::const_iterator
                   ext = mf->GetSourceExtensions().begin();
                   ext !=  mf->GetSourceExtensions().end();
                   ++ext)
                 {
-                if ((*si)->GetExtension() == *ext)
+                if (srcext == *ext)
                   {
                   isCFile = true;
                   break;

+ 2 - 1
Source/cmExtraCodeLiteGenerator.cxx

@@ -223,12 +223,13 @@ void cmExtraCodeLiteGenerator
             std::string lang = (*si)->GetLanguage();
             if (lang == "C" || lang == "CXX")
               {
+              std::string srcext = (*si)->GetExtension();
               for(std::vector<std::string>::const_iterator
                   ext = mf->GetSourceExtensions().begin();
                   ext !=  mf->GetSourceExtensions().end();
                   ++ext)
                 {
-                if ((*si)->GetExtension() == *ext)
+                if (srcext == *ext)
                   {
                   isCFile = true;
                   break;