Skip to content

Commit adf7652

Browse files
committed
histogram: Treat num_buckets consistently
Changes the semantics of num_buckets() to match the num_buckets constructor argument. Setting num_buckets assumed the user did not include the +1 bucket for above_range; getting num_buckets() did include the above_range bucket.
1 parent 455b4c6 commit adf7652

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

core/utils/histogram.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ class Histogram {
175175
return ret;
176176
}
177177

178-
size_t num_buckets() const { return buckets_.size(); }
178+
size_t num_buckets() const { return buckets_.size() - 1; }
179179
T bucket_width() const { return bucket_width_; }
180180

181181
size_t max_num_buckets() const {

0 commit comments

Comments
 (0)