mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[Support] Timer: Use emplace_back() and range-based loops (NFC)
llvm-svn: 256217
This commit is contained in:
parent
e4167de423
commit
bd22e09f55
@ -272,7 +272,7 @@ void TimerGroup::removeTimer(Timer &T) {
|
||||
|
||||
// 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;
|
||||
|
||||
@ -306,8 +306,8 @@ void TimerGroup::PrintQueuedTimers(raw_ostream &OS) {
|
||||
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";
|
||||
@ -358,7 +358,7 @@ void TimerGroup::print(raw_ostream &OS) {
|
||||
// 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;
|
||||
|
Loading…
Reference in New Issue
Block a user