summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.cxx
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2014-03-12 05:48:06 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2014-06-09 18:46:45 (GMT)
commite17a69bc744ce0ed36e41be36694ca0053330d78 (patch)
tree988032ab9176656d58ecc0be97cab57c5c576fc2 /Source/cmDefinitions.cxx
parent3b21705d534c16a6197f28db68ea81e2816bfec3 (diff)
downloadCMake-e17a69bc744ce0ed36e41be36694ca0053330d78.zip
CMake-e17a69bc744ce0ed36e41be36694ca0053330d78.tar.gz
CMake-e17a69bc744ce0ed36e41be36694ca0053330d78.tar.bz2
cmDefinitions: Use a hashmap for faster checks
The hash map is much faster at checking that the map won't have what we're looking for so that we can just go to the parent scope instead.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r--Source/cmDefinitions.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 6502163..5515f35 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -15,7 +15,8 @@
cmDefinitions::Def cmDefinitions::NoDef;
//----------------------------------------------------------------------------
-cmDefinitions::cmDefinitions(cmDefinitions* parent): Up(parent)
+cmDefinitions::cmDefinitions(cmDefinitions* parent)
+ : Up(parent)
{
}
@@ -35,7 +36,7 @@ cmDefinitions::GetInternal(const std::string& key) const
{
return i->second;
}
- else if(cmDefinitions* up = this->Up)
+ if(cmDefinitions* up = this->Up)
{
// Query the parent scope.
return up->GetInternal(key);