diff options
author | Brad King <brad.king@kitware.com> | 2019-08-08 18:50:09 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-08-20 13:36:45 (GMT) |
commit | be7807478c463c5c875798a3e2e72e148c0d0c3e (patch) | |
tree | 05152d75d6aa1d520c6e6da48732d095037f002d /Source/cmDefinitions.h | |
parent | e07e2bc8bbf25178270e8086575ff398dd1fa0c6 (diff) | |
download | CMake-be7807478c463c5c875798a3e2e72e148c0d0c3e.zip CMake-be7807478c463c5c875798a3e2e72e148c0d0c3e.tar.gz CMake-be7807478c463c5c875798a3e2e72e148c0d0c3e.tar.bz2 |
cmDefinitions: Reduce allocation of keys and values in MakeClosure
Use `cm::String` to store keys and values so that `MakeClosure` does
not need to allocate new copies of all of them.
Issue: #19581
Diffstat (limited to 'Source/cmDefinitions.h')
-rw-r--r-- | Source/cmDefinitions.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h index 787471a..b4d6419 100644 --- a/Source/cmDefinitions.h +++ b/Source/cmDefinitions.h @@ -8,7 +8,9 @@ #include "cm_string_view.hxx" #include "cmLinkedTree.h" +#include "cmString.hxx" +#include <functional> #include <string> #include <unordered_map> #include <vector> @@ -57,16 +59,14 @@ private: Def() = default; Def(cm::string_view value) : Value(value) - , Exists(true) { } - std::string Value; - bool Exists = false; + cm::String Value; bool Used = false; }; static Def NoDef; - std::unordered_map<std::string, Def> Map; + std::unordered_map<cm::String, Def> Map; static Def const& GetInternal(const std::string& key, StackIter begin, StackIter end, bool raise); |