Merge topic 'performance_fix'

3e4ba89 Only pay for unused variable checking if it is on.
This commit is contained in:
Brad King 2011-07-26 14:55:21 -04:00 committed by CMake Topic Stage
commit 9340ab28cc
1 changed files with 4 additions and 0 deletions

View File

@ -1759,6 +1759,10 @@ void cmMakefile::AddDefinition(const char* name, bool value)
void cmMakefile::CheckForUnusedVariables() const void cmMakefile::CheckForUnusedVariables() const
{ {
if (!this->WarnUnused)
{
return;
}
const cmDefinitions& defs = this->Internal->VarStack.top(); const cmDefinitions& defs = this->Internal->VarStack.top();
const std::set<cmStdString>& locals = defs.LocalKeys(); const std::set<cmStdString>& locals = defs.LocalKeys();
std::set<cmStdString>::const_iterator it = locals.begin(); std::set<cmStdString>::const_iterator it = locals.begin();