Skip to content

Commit bf68510

Browse files
committed
f How I learned to love the unwrap
1 parent 597d832 commit bf68510

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lightning-background-processor/src/fwd_batch.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,12 @@ impl BatchDelay {
3131
}
3232

3333
fn rand_batch_delay_millis() -> u16 {
34-
const FALLBACK_DELAY: u16 = 50;
3534
const USIZE_LEN: usize = core::mem::size_of::<usize>();
3635
let mut random_bytes = [0u8; USIZE_LEN];
3736
possiblyrandom::getpossiblyrandom(&mut random_bytes);
3837

3938
let index = usize::from_be_bytes(random_bytes) % FWD_DELAYS_MILLIS.len();
40-
*FWD_DELAYS_MILLIS.get(index).unwrap_or(&FALLBACK_DELAY)
39+
FWD_DELAYS_MILLIS[index]
4140
}
4241

4342
// An array of potential forwarding delays (log-normal distribution, 10000 samples, mean = 50, sd = 0.5), generated via the following R-script:

0 commit comments

Comments
 (0)