Skip to content

Commit ed7f3e0

Browse files
authored
Merge pull request #15 from marshallpierce/simplify-num_bins
Use sub_bucket_half_count instead of dividing sub_bucket_count
2 parents 6494f3c + 4b6d1e5 commit ed7f3e0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1276,8 +1276,7 @@ impl<T: Counter> Histogram<T> {
12761276
/// Or, equivalently, we need 1 more bucket to capture the max value if we consider the
12771277
/// sub-bucket length to be halved.
12781278
fn num_bins(&self, number_of_buckets: u8) -> u32 {
1279-
// TODO use sub_bucket_half_count
1280-
(number_of_buckets as u32 + 1) * (self.sub_bucket_count / 2)
1279+
(number_of_buckets as u32 + 1) * (self.sub_bucket_half_count)
12811280
}
12821281

12831282
/// Compute the number of buckets needed to cover the given value, as well as the total number

0 commit comments

Comments
 (0)