Browse Source

cmMakefile: Remove redundant conditions.

This container is never empty.
Stephen Kelly 10 years ago
parent
commit
c42f0e2b3e
1 changed files with 3 additions and 6 deletions
  1. 3 6
      Source/cmMakefile.cxx

+ 3 - 6
Source/cmMakefile.cxx

@@ -1730,8 +1730,7 @@ void cmMakefile::AddDefinition(const std::string& name, const char* value)
     }
 
   this->Internal->SetDefinition(name, value);
-  if (!this->Internal->VarUsageStack.empty() &&
-      this->VariableInitialized(name))
+  if (this->VariableInitialized(name))
     {
     this->CheckForUnused("changing definition", name);
     this->Internal->VarUsageStack.top().erase(name);
@@ -1806,8 +1805,7 @@ void cmMakefile::AddCacheDefinition(const std::string& name, const char* value,
 void cmMakefile::AddDefinition(const std::string& name, bool value)
 {
   this->Internal->SetDefinition(name, value ? "ON" : "OFF");
-  if (!this->Internal->VarUsageStack.empty() &&
-      this->VariableInitialized(name))
+  if (this->VariableInitialized(name))
     {
     this->CheckForUnused("changing definition", name);
     this->Internal->VarUsageStack.top().erase(name);
@@ -1904,8 +1902,7 @@ void cmMakefile::CheckForUnused(const char* reason,
 void cmMakefile::RemoveDefinition(const std::string& name)
 {
   this->Internal->RemoveDefinition(name);
-  if (!this->Internal->VarUsageStack.empty() &&
-      this->VariableInitialized(name))
+  if (this->VariableInitialized(name))
     {
     this->CheckForUnused("unsetting", name);
     this->Internal->VarUsageStack.top().erase(name);