summaryrefslogtreecommitdiffstats
path: root/Source/cmMacroCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2003-06-24 19:11:21 (GMT)
committerKen Martin <ken.martin@kitware.com>2003-06-24 19:11:21 (GMT)
commit76b344c6fe1e0b66da040649f37f55215e0745a7 (patch)
treee7e4b878d26a2f44365d01c68fe138094c176dfc /Source/cmMacroCommand.cxx
parent117f961a5adda76ebb87a96b323e66aa3ec0c0b8 (diff)
downloadCMake-76b344c6fe1e0b66da040649f37f55215e0745a7.zip
CMake-76b344c6fe1e0b66da040649f37f55215e0745a7.tar.gz
CMake-76b344c6fe1e0b66da040649f37f55215e0745a7.tar.bz2
performance improvements
Diffstat (limited to 'Source/cmMacroCommand.cxx')
-rw-r--r--Source/cmMacroCommand.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index fa013c7..62d6724 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -20,20 +20,19 @@ bool cmMacroFunctionBlocker::
IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
{
// record commands until we hit the ENDMACRO
- // at the ENDMACRO call we shift gears and start looking for invocations
- if(lff.m_Name == "ENDMACRO")
+ if (!m_Executing)
{
- std::vector<std::string> expandedArguments;
- mf.ExpandArguments(lff.m_Arguments, expandedArguments);
- if(!expandedArguments.empty() && (expandedArguments[0] == m_Args[0]))
+ // at the ENDMACRO call we shift gears and start looking for invocations
+ if(lff.m_Name == "ENDMACRO")
{
- m_Executing = true;
- return true;
+ std::vector<std::string> expandedArguments;
+ mf.ExpandArguments(lff.m_Arguments, expandedArguments);
+ if(!expandedArguments.empty() && (expandedArguments[0] == m_Args[0]))
+ {
+ m_Executing = true;
+ return true;
+ }
}
- }
-
- if (!m_Executing)
- {
// if it wasn't an endmacro and we are not executing then we must be
// recording
m_Functions.push_back(lff);
@@ -63,10 +62,12 @@ IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile &mf)
}
// Invoke all the functions that were collected in the block.
+ cmListFileFunction newLFF;
for(unsigned int c = 0; c < m_Functions.size(); ++c)
{
// Replace the formal arguments and then invoke the command.
- cmListFileFunction newLFF;
+ newLFF.m_Arguments.clear();
+ newLFF.m_Arguments.reserve(m_Functions[c].m_Arguments.size());
newLFF.m_Name = m_Functions[c].m_Name;
newLFF.m_FilePath = m_Functions[c].m_FilePath;
newLFF.m_Line = m_Functions[c].m_Line;