diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-26 10:39:53 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-29 22:32:48 (GMT) |
commit | b48ea26a9d3b4384874554fe64edfce8784a9255 (patch) | |
tree | ca8df4ac4a346d389682e58e58e2fd72de3c3255 | |
parent | 5ccff6408c93e67d7f8445ce1bf6465b068d6f6b (diff) | |
download | CMake-b48ea26a9d3b4384874554fe64edfce8784a9255.zip CMake-b48ea26a9d3b4384874554fe64edfce8784a9255.tar.gz CMake-b48ea26a9d3b4384874554fe64edfce8784a9255.tar.bz2 |
cmDefinitions: Invert conditional code.
Return the simple case first.
-rw-r--r-- | Source/cmDefinitions.cxx | 11 |
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; } //---------------------------------------------------------------------------- |