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
@@ -54,7 +54,7 @@ class StatsReport final {
// * is always first
for (auto& itr : s_allStats) {
V3Statistic* repp = &itr;
byName.insert(make_pair(repp->name(), repp));
byName.emplace(repp->name(), repp);
}
// Process duplicates
@@ -79,7 +79,7 @@ class StatsReport final {
const V3Statistic* repp = &itr;
if (repp->stage() == "*" && repp->printit()) {
if (maxWidth < repp->name().length()) maxWidth = repp->name().length();
byName.insert(make_pair(repp->name(), repp));
byName.emplace(repp->name(), repp);
}
}
@@ -123,10 +123,10 @@ class StatsReport final {
if (repp->stage() != "*" && repp->printit()) {
if (maxWidth < repp->name().length()) maxWidth = repp->name().length();
if (stageInt.find(repp->stage()) == stageInt.end()) {
stageInt.insert(make_pair(repp->stage(), stage++));
stageInt.emplace(repp->stage(), stage++);
stages.push_back(repp->stage());
}
byName.insert(make_pair(repp->name(), repp));
byName.emplace(repp->name(), repp);
}
}