Bug 1337358 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in security/sandbox/ r=gcp
authorSylvestre Ledru <sledru@mozilla.com>
Wed, 08 Feb 2017 11:59:38 +0100
changeset 342528 2f804e38c8cb0e4e9f2d41cbb60393341d09b3a0
parent 342527 a39e29e8f86432c4b7ac0b5c4d9618d899a4953e
child 342529 bdb6ce37cb92f55f874eb7458b1dc7be3b9c49b5
push id31357
push userkwierso@gmail.com
push dateTue, 14 Feb 2017 00:49:21 +0000
treeherdermozilla-central@bca082441767 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp
bugs1337358
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1337358 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in security/sandbox/ r=gcp MozReview-Commit-ID: Iwj7i07LkJ0
security/sandbox/linux/gtest/TestBroker.cpp
--- a/security/sandbox/linux/gtest/TestBroker.cpp
+++ b/security/sandbox/linux/gtest/TestBroker.cpp
@@ -101,22 +101,22 @@ protected:
     ASSERT_EQ(0, pthread_create(aThread, nullptr, ThreadMain<C, Main>,
                                 static_cast<C*>(this)));
   }
 
   template<class C, void (C::* Main)()>
   void RunOnManyThreads() {
     static const int kNumThreads = 5;
     pthread_t threads[kNumThreads];
-    for (int i = 0; i < kNumThreads; ++i) {
-      StartThread<C, Main>(&threads[i]);
+    for (pthread_t & thread : threads) {
+      StartThread<C, Main>(&thread);
     }
-    for (int i = 0; i < kNumThreads; ++i) {
+    for (pthread_t thread : threads) {
       void* retval;
-      ASSERT_EQ(pthread_join(threads[i], &retval), 0);
+      ASSERT_EQ(pthread_join(thread, &retval), 0);
       ASSERT_EQ(retval, static_cast<void*>(nullptr));
     }
   }
 
 public:
   void MultiThreadOpenWorker();
   void MultiThreadStatWorker();
 };