cmDefinitions: Invert conditional code.

Return the simple case first.
This commit is contained in:
Stephen Kelly 2015-04-26 12:39:53 +02:00
parent 5ccff6408c
commit b48ea26a9d
1 changed files with 6 additions and 5 deletions

View File

@ -29,13 +29,14 @@ cmDefinitions::GetInternal(const std::string& key)
{ {
return i->second; return i->second;
} }
if(cmDefinitions* up = this->Up) cmDefinitions* up = this->Up;
if(!up)
{ {
// Query the parent scope and store the result locally. return this->NoDef;
Def def = up->GetInternal(key);
return this->Map.insert(MapType::value_type(key, def)).first->second;
} }
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;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------