Bug 1319752 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in startupcache/. draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 23 Nov 2016 14:22:23 +0200
changeset 442861 1b24f0a6be406daacf9c8a4c37d15f09ce078e7e
parent 442499 1a3194836cb4c3da6ba3a9742a2d25cf26669b55
child 442862 f265a9c32a52fe316d0152ba88aa3ecd832fdf66
push id36849
push userbmo:bpostelnicu@mozilla.com
push dateWed, 23 Nov 2016 12:27:27 +0000
bugs1319752
milestone53.0a1
Bug 1319752 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in startupcache/. MozReview-Commit-ID: G0hV6yoZIVg
startupcache/StartupCache.cpp
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -435,18 +435,18 @@ StartupCache::WriteToDisk()
     return;
   }
 
   CacheWriteHolder holder;
   holder.stream = stream;
   holder.writer = zipW;
   holder.time = now;
 
-  for (auto key = mPendingWrites.begin(); key != mPendingWrites.end(); key++) {
-    CacheCloseHelper(*key, mTable.Get(*key), &holder);
+  for (auto& key : mPendingWrites) {
+    CacheCloseHelper(key, mTable.Get(key), &holder);
   }
   mPendingWrites.Clear();
   mTable.Clear();
 
   // Close the archive so Windows doesn't choke.
   mArchive = nullptr;
   zipW->Close();