Skip to content

Commit f48f54b

Browse files
committed
f decays a bit more concise
1 parent 0535a62 commit f48f54b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lightning/src/routing/scoring.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,7 @@ impl<L: Deref<Target = u64>, BRT: Deref<Target = HistoricalBucketRangeTracker>,
824824
let mut total_valid_points_tracked = 0;
825825
let decays = self.now.duration_since(*self.last_updated).as_secs()
826826
.checked_div(params.historical_no_updates_half_life.as_secs())
827-
.map(|decays| cmp::min(decays, u32::max_value() as u64) as u32)
828-
.unwrap_or(u32::max_value());
827+
.map_or(u32::max_value(), |decays| cmp::min(decays, u32::max_value() as u64) as u32);
829828
// Rather than actually decaying the individual buckets, which would lose precision, we
830829
// simply track whether any buckets have data which wouldn't be decayed to zero, and if
831830
// there are none, treat it as if we had no data.

0 commit comments

Comments
 (0)