summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-26 10:39:53 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-29 22:32:48 (GMT)
commitb48ea26a9d3b4384874554fe64edfce8784a9255 (patch)
treeca8df4ac4a346d389682e58e58e2fd72de3c3255 /Source/cmDefinitions.cxx
parent5ccff6408c93e67d7f8445ce1bf6465b068d6f6b (diff)
downloadCMake-b48ea26a9d3b4384874554fe64edfce8784a9255.zip
CMake-b48ea26a9d3b4384874554fe64edfce8784a9255.tar.gz
CMake-b48ea26a9d3b4384874554fe64edfce8784a9255.tar.bz2
cmDefinitions: Invert conditional code.
Return the simple case first.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r--Source/cmDefinitions.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 115e30a..61328be 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -29,13 +29,14 @@ cmDefinitions::GetInternal(const std::string& key)
{
return i->second;
}
- if(cmDefinitions* up = this->Up)
+ cmDefinitions* up = this->Up;
+ if(!up)
{
- // Query the parent scope and store the result locally.
- Def def = up->GetInternal(key);
- return this->Map.insert(MapType::value_type(key, def)).first->second;
+ return this->NoDef;
}
- return this->NoDef;
+ // Query the parent scope and store the result locally.
+ Def def = up->GetInternal(key);
+ return this->Map.insert(MapType::value_type(key, def)).first->second;
}
//----------------------------------------------------------------------------