For performance, use unordered_set/map where possible. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-11-25 20:57:30 -05:00
parent 085ef5fc05
commit f2d8e45d72
22 changed files with 34 additions and 28 deletions
+2 -2
View File
@@ -123,7 +123,7 @@ class LifeBlock final {
// LIFE MAP
// For each basic block, we'll make a new map of what variables that if/else is changing
typedef std::map<AstVarScope*, LifeVarEntry> LifeMap;
typedef std::unordered_map<AstVarScope*, LifeVarEntry> LifeMap;
LifeMap m_map; // Current active lifetime map for current scope
LifeBlock* m_aboveLifep; // Upper life, or nullptr
LifeState* m_statep; // Current global state
@@ -278,7 +278,7 @@ private:
// LIFE MAP
// For each basic block, we'll make a new map of what variables that if/else is changing
typedef std::map<AstVarScope*, LifeVarEntry> LifeMap;
typedef std::unordered_map<AstVarScope*, LifeVarEntry> LifeMap;
// cppcheck-suppress memleak // cppcheck bug - it is deleted
LifeBlock* m_lifep; // Current active lifetime map for current scope