summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/metrics/metrics_service.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 858032a..5fcdb3a 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -1498,8 +1498,9 @@ bool MetricsService::ProbabilityTest(double probability,
// string somehow to get a big integer idnumber (could be negative
// from wraparound)
int big = 1;
- for (size_t j = n - 1; j >= 0; --j) {
- idnumber += static_cast<int>(client_id_c_str[j]) * big;
+ int last_pos = n - 1;
+ for (size_t j = 0; j < n; ++j) {
+ idnumber += static_cast<int>(client_id_c_str[last_pos - j]) * big;
big *= 10;
}