summaryrefslogtreecommitdiffstats
path: root/Source/cmDefinitions.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-08 18:50:09 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-20 13:36:45 (GMT)
commitbe7807478c463c5c875798a3e2e72e148c0d0c3e (patch)
tree05152d75d6aa1d520c6e6da48732d095037f002d /Source/cmDefinitions.h
parente07e2bc8bbf25178270e8086575ff398dd1fa0c6 (diff)
downloadCMake-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.h8
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);