Use C++11 for loops, from clang-migrate. No functional change intended

This commit is contained in:
Wilson Snyder
2020-11-10 22:10:38 -05:00
parent 44eb362a18
commit 79d33bf1ee
39 changed files with 152 additions and 199 deletions
+10 -10
View File
@@ -53,15 +53,15 @@ class StatsReport {
typedef std::multimap<string, V3Statistic*> ByName;
ByName byName;
// * is always first
for (StatColl::iterator it = s_allStats.begin(); it != s_allStats.end(); ++it) {
V3Statistic* repp = &(*it);
for (auto& itr : s_allStats) {
V3Statistic* repp = &itr;
byName.insert(make_pair(repp->name(), repp));
}
// Process duplicates
V3Statistic* lastp = nullptr;
for (ByName::iterator it = byName.begin(); it != byName.end(); ++it) {
V3Statistic* repp = it->second;
for (const auto& itr : byName) {
V3Statistic* repp = itr.second;
if (lastp && lastp->sumit() && lastp->printit() && lastp->name() == repp->name()
&& lastp->stage() == repp->stage()) {
repp->combineWith(lastp);
@@ -76,8 +76,8 @@ class StatsReport {
typedef std::multimap<string, const V3Statistic*> ByName;
ByName byName;
// * is always first
for (StatColl::iterator it = s_allStats.begin(); it != s_allStats.end(); ++it) {
const V3Statistic* repp = &(*it);
for (const auto& itr : s_allStats) {
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));
@@ -87,8 +87,8 @@ class StatsReport {
// Print organized by stage
os << "Global Statistics:\n";
os << endl;
for (ByName::iterator it = byName.begin(); it != byName.end(); ++it) {
const V3Statistic* repp = it->second;
for (const auto& itr : byName) {
const V3Statistic* repp = itr.second;
if (repp->perf()) continue;
os << " " << std::left << std::setw(maxWidth) << repp->name();
repp->dump(os);
@@ -99,8 +99,8 @@ class StatsReport {
// Print organized by stage
os << "Performance Statistics:\n";
os << endl;
for (ByName::iterator it = byName.begin(); it != byName.end(); ++it) {
const V3Statistic* repp = it->second;
for (const auto& itr : byName) {
const V3Statistic* repp = itr.second;
if (!repp->perf()) continue;
os << " " << std::left << std::setw(maxWidth) << repp->name();
repp->dump(os);