Internals: Use emplace instead of insert(make_pair(...)). No functional change intended.

This commit is contained in:
Wilson Snyder
2020-12-18 18:24:47 -05:00
parent d0c4aee7b5
commit c39a8b439a
41 changed files with 86 additions and 96 deletions
+4 -4
View File
@@ -109,7 +109,7 @@ private:
(m_aboveCellp ? static_cast<AstNode*>(m_aboveCellp) : static_cast<AstNode*>(nodep))
->fileline(),
nodep, scopename, m_aboveScopep, m_aboveCellp);
if (VN_IS(nodep, Package)) m_packageScopes.insert(make_pair(nodep, m_scopep));
if (VN_IS(nodep, Package)) m_packageScopes.emplace(nodep, m_scopep);
// Now for each child cell, iterate the module this cell points to
for (AstNode* cellnextp = nodep->stmtsp(); cellnextp; cellnextp = cellnextp->nextp()) {
@@ -169,7 +169,7 @@ private:
: static_cast<AstNode*>(nodep));
m_scopep
= new AstScope(abovep->fileline(), m_modp, scopename, m_aboveScopep, m_aboveCellp);
m_packageScopes.insert(make_pair(nodep, m_scopep));
m_packageScopes.emplace(nodep, m_scopep);
// Create scope for the current usage of this cell
AstNode::user1ClearTree();
@@ -272,7 +272,7 @@ private:
nodep->attrClocker(VVarAttrClocker::CLOCKER_NO);
}
UASSERT_OBJ(m_scopep, nodep, "No scope for var");
m_varScopes.insert(make_pair(make_pair(nodep, m_scopep), varscp));
m_varScopes.emplace(make_pair(nodep, m_scopep), varscp);
m_scopep->addVarp(varscp);
}
}
@@ -287,7 +287,7 @@ private:
// the var's referenced package etc might not be created yet.
// So push to a list and post-correct.
// No check here for nodep->classOrPackagep(), will check when walk list.
m_varRefScopes.insert(make_pair(nodep, m_scopep));
m_varRefScopes.emplace(nodep, m_scopep);
}
}
virtual void visit(AstScopeName* nodep) override {