Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: src/IceTimerTree.cpp

Issue 830303003: Subzero: Clean up a few areas. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rewrite another loop using reverse_range() Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTimerTree.h ('k') | src/IceTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTimerTree.cpp
diff --git a/src/IceTimerTree.cpp b/src/IceTimerTree.cpp
index 9f2340dd56513e5a8ce725871b453376c6ec23e2..2c912e489d16884d9446560bddac0bc797636a8a 100644
--- a/src/IceTimerTree.cpp
+++ b/src/IceTimerTree.cpp
@@ -141,12 +141,11 @@ typedef std::multimap<double, IceString> DumpMapType;
void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) {
if (!ALLOW_DUMP)
return;
- // TODO(stichnot): Use llvm::make_range with LLVM 3.5.
- for (auto I = Map.rbegin(), E = Map.rend(); I != E; ++I) {
+ for (auto &I : reverse_range(Map)) {
char buf[80];
- snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I->first,
- I->first * 100 / TotalTime);
- Str << buf << I->second << "\n";
+ snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I.first,
+ I.first * 100 / TotalTime);
+ Str << buf << I.second << "\n";
}
}
« no previous file with comments | « src/IceTimerTree.h ('k') | src/IceTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698