speedup: Cache strings for comparisons
This commit is contained in:
parent
7abf4e313d
commit
caaad35759
|
@ -414,12 +414,13 @@ void cmExtraCodeBlocksGenerator
|
||||||
std::string lang = (*si)->GetLanguage();
|
std::string lang = (*si)->GetLanguage();
|
||||||
if (lang == "C" || lang == "CXX")
|
if (lang == "C" || lang == "CXX")
|
||||||
{
|
{
|
||||||
|
std::string srcext = (*si)->GetExtension();
|
||||||
for(std::vector<std::string>::const_iterator
|
for(std::vector<std::string>::const_iterator
|
||||||
ext = mf->GetSourceExtensions().begin();
|
ext = mf->GetSourceExtensions().begin();
|
||||||
ext != mf->GetSourceExtensions().end();
|
ext != mf->GetSourceExtensions().end();
|
||||||
++ext)
|
++ext)
|
||||||
{
|
{
|
||||||
if ((*si)->GetExtension() == *ext)
|
if (srcext == *ext)
|
||||||
{
|
{
|
||||||
isCFile = true;
|
isCFile = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -223,12 +223,13 @@ void cmExtraCodeLiteGenerator
|
||||||
std::string lang = (*si)->GetLanguage();
|
std::string lang = (*si)->GetLanguage();
|
||||||
if (lang == "C" || lang == "CXX")
|
if (lang == "C" || lang == "CXX")
|
||||||
{
|
{
|
||||||
|
std::string srcext = (*si)->GetExtension();
|
||||||
for(std::vector<std::string>::const_iterator
|
for(std::vector<std::string>::const_iterator
|
||||||
ext = mf->GetSourceExtensions().begin();
|
ext = mf->GetSourceExtensions().begin();
|
||||||
ext != mf->GetSourceExtensions().end();
|
ext != mf->GetSourceExtensions().end();
|
||||||
++ext)
|
++ext)
|
||||||
{
|
{
|
||||||
if ((*si)->GetExtension() == *ext)
|
if (srcext == *ext)
|
||||||
{
|
{
|
||||||
isCFile = true;
|
isCFile = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue