Skip to content

Commit 9896f67

Browse files
committed
f decays a bit more concise
1 parent 29f2d2a commit 9896f67

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lightning/src/routing/scoring.rs

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

0 commit comments

Comments
 (0)