Bug 1337358 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in tools/ r?froydnj
MozReview-Commit-ID: GdeCzDXjzzg
--- a/tools/power/rapl.cpp
+++ b/tools/power/rapl.cpp
@@ -714,18 +714,18 @@ Finish()
//
// where |x| is the sum variable, |m| is the mean, and |n| is the
// population size.
//
// This is different from the *sample* standard deviation, which divides by
// |n - 1|, and would be appropriate if we were using a random sample of a
// larger population.
double sumOfSquaredDeviations = 0;
- for (auto iter = gTotals_W.begin(); iter != gTotals_W.end(); ++iter) {
- double deviation = (*iter - mean);
+ for (double & iter : gTotals_W) {
+ double deviation = (iter - mean);
sumOfSquaredDeviations += deviation * deviation;
}
double popStdDev = sqrt(sumOfSquaredDeviations / n);
// Sort so that percentiles can be determined. We use the "Nearest Rank"
// method of determining percentiles, which is simplest to compute and which
// chooses values from those that appear in the input set.
std::sort(gTotals_W.begin(), gTotals_W.end());