summaryrefslogtreecommitdiff
path: root/Source/cmDefinitions.h
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-08-08 13:50:47 +0200
committerSebastian Holtermann <sebholt@xwmw.org>2019-08-08 14:12:43 +0200
commit1a47d368d8925c8c7e3a8afc75f9592058cce100 (patch)
tree6d3a1e3e1676266b8f00d995b12ec314d86dfd27 /Source/cmDefinitions.h
parent38a5b0203fe116268afbdb8d82fc8d89c3b213f2 (diff)
downloadcmake-1a47d368d8925c8c7e3a8afc75f9592058cce100.tar.gz
cmDefinitions: Cleanups and optimizations
In cmDefinitions: - sort methods in source code by static or not static - use `std::unordered_set<cm::string_view>` instead of `std::set<std::string>` for duplications tests.
Diffstat (limited to 'Source/cmDefinitions.h')
-rw-r--r--Source/cmDefinitions.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 4d8810a96b..787471a700 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -25,6 +25,8 @@ class cmDefinitions
typedef cmLinkedTree<cmDefinitions>::iterator StackIter;
public:
+ // -- Static member functions
+
static const std::string* Get(const std::string& key, StackIter begin,
StackIter end);
@@ -32,18 +34,21 @@ public:
static bool HasKey(const std::string& key, StackIter begin, StackIter end);
+ static std::vector<std::string> ClosureKeys(StackIter begin, StackIter end);
+
+ static cmDefinitions MakeClosure(StackIter begin, StackIter end);
+
+ // -- Member functions
+
/** Set a value associated with a key. */
void Set(const std::string& key, cm::string_view value);
/** Unset a definition. */
void Unset(const std::string& key);
+ /** List of unused keys. */
std::vector<std::string> UnusedKeys() const;
- static std::vector<std::string> ClosureKeys(StackIter begin, StackIter end);
-
- static cmDefinitions MakeClosure(StackIter begin, StackIter end);
-
private:
/** String with existence boolean. */
struct Def
@@ -61,8 +66,7 @@ private:
};
static Def NoDef;
- typedef std::unordered_map<std::string, Def> MapType;
- MapType Map;
+ std::unordered_map<std::string, Def> Map;
static Def const& GetInternal(const std::string& key, StackIter begin,
StackIter end, bool raise);