Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Unified Diff: base/metrics/histogram.cc

Issue 10823137: 1. Add test for https://src.chromium.org/viewvc/chrome?view=rev&revision=149541 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/metrics/histogram_unittest.cc » ('j') | base/metrics/histogram_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.cc
===================================================================
--- base/metrics/histogram.cc (revision 149541)
+++ base/metrics/histogram.cc (working copy)
@@ -883,14 +883,15 @@
// static
bool CustomHistogram::ValidateCustomRanges(
const vector<Sample>& custom_ranges) {
- if (custom_ranges.size() < 1)
- return false;
+ int valid_ranges = 0;
jar (doing other things) 2012/08/03 21:53:42 Suggest use boolean: bool valid_ranges = false; t
kaiwang 2012/08/03 22:15:53 Done.
for (size_t i = 0; i < custom_ranges.size(); i++) {
Sample s = custom_ranges[i];
jar (doing other things) 2012/08/03 21:53:42 nit: (on existing code): Please use |sample| inste
kaiwang 2012/08/03 22:15:53 Done.
if (s < 0 || s > HistogramBase::kSampleType_MAX - 1)
return false;
+ if (s != 0)
+ valid_ranges++;
}
- return true;
+ return valid_ranges > 0;
}
// static
« no previous file with comments | « no previous file | base/metrics/histogram_unittest.cc » ('j') | base/metrics/histogram_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698