summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.h
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.h
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.h')
-rw-r--r--Source/cmDefinitions.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index ebe6fa5..5209a8b 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -13,6 +13,9 @@
#define cmDefinitions_h
#include "cmStandardIncludes.h"
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+#include "cmsys/hash_map.hxx"
+#endif
/** \class cmDefinitions
* \brief Store a scope of variable definitions for CMake language.
@@ -71,7 +74,11 @@ private:
cmDefinitions* Up;
// Local definitions, set or unset.
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ typedef cmsys::hash_map<std::string, Def> MapType;
+#else
typedef std::map<std::string, Def> MapType;
+#endif
MapType Map;
// Internal query and update methods.