We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64fb326 commit efd9ca7Copy full SHA for efd9ca7
src/lib.rs
@@ -1241,7 +1241,8 @@ impl<T: Counter> Histogram<T> {
1241
1242
#[inline]
1243
fn value_from_loc(&self, bucket_index: u8, sub_bucket_index: u32) -> u64 {
1244
- // sum won't overflow; bucket_index and unit_magnitude are both <= 64
+ // sum won't overflow; bucket_index and unit_magnitude are both <= 64.
1245
+ // However, the resulting shift may overflow if unit magnitude is large, for instance.
1246
(sub_bucket_index as u64) << (bucket_index + self.unit_magnitude)
1247
}
1248
0 commit comments