Skip to content

Commit 502a84d

Browse files
committed
left a stray variable
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
1 parent 626bafb commit 502a84d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lading_payload/src/opentelemetry/metric/templates.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@ pub(crate) type Pool = GenericPool<ResourceMetrics, ResourceTemplateGenerator>;
2828
///
2929
/// For example, with min=1, max=60:
3030
/// - ~50% chance of returning 1
31-
/// - ~25% chance of returning 2-3
31+
/// - ~25% chance of returning 2-3
3232
/// - ~12.5% chance of returning 4-7
3333
/// - And so on...
3434
fn weighted_range<R: Rng + ?Sized>(rng: &mut R, min: u32, max: u32) -> u32 {
3535
if min >= max {
3636
return min;
3737
}
3838

39-
let range = max - min + 1;
4039
let mut current = min;
4140
let mut step = 1;
4241

@@ -45,7 +44,7 @@ fn weighted_range<R: Rng + ?Sized>(rng: &mut R, min: u32, max: u32) -> u32 {
4544
return rng.random_range(current..=current.min(max));
4645
}
4746
current = (current + step).min(max);
48-
step = step * 2;
47+
step *= 2;
4948
}
5049

5150
max

0 commit comments

Comments
 (0)