speedup: Cache strings for comparisons

This commit is contained in:
Ben Boeckel 2014-02-24 20:47:20 -05:00 committed by Brad King
parent 7abf4e313d
commit caaad35759
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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;