// If the timer was started, move its data to TimersToPrint.
if (T.Started)
- TimersToPrint.push_back(std::make_pair(T.Time, T.Name));
+ TimersToPrint.emplace_back(T.Time, T.Name);
T.TG = nullptr;
std::sort(TimersToPrint.begin(), TimersToPrint.end());
TimeRecord Total;
- for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
- Total += TimersToPrint[i].first;
+ for (auto &RecordNamePair : TimersToPrint)
+ Total += RecordNamePair.first;
// Print out timing header.
OS << "===" << std::string(73, '-') << "===\n";
// reset them.
for (Timer *T = FirstTimer; T; T = T->Next) {
if (!T->Started) continue;
- TimersToPrint.push_back(std::make_pair(T->Time, T->Name));
+ TimersToPrint.emplace_back(T->Time, T->Name);
// Clear out the time.
T->Started = 0;