Skip to content

Commit d4372af

Browse files
committed
Simply GetCumulativeCounts
1 parent 484c2be commit d4372af

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/test/metrics_api_test.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,8 @@ GetCumulativeCounts(
252252
}
253253
}
254254

255-
double cumulative_sum = 0.0;
256-
for (int i = 0; i < cumulative_counts.size(); ++i) {
257-
std::cout << cumulative_counts[i] << std::endl;
258-
cumulative_sum += cumulative_counts[i];
259-
cumulative_counts[i] = cumulative_sum;
255+
for (int i = 1; i < cumulative_counts.size(); ++i) {
256+
cumulative_counts[i] += cumulative_counts[i - 1];
260257
}
261258
return cumulative_counts;
262259
}

0 commit comments

Comments
 (0)