diff --git a/lightning/src/routing/scoring.rs b/lightning/src/routing/scoring.rs index c1fd2288595..9cf466a1c03 100644 --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@ -823,8 +823,7 @@ impl, BRT: Deref, let mut total_valid_points_tracked = 0; let decays = self.now.duration_since(*self.last_updated).as_secs() .checked_div(params.historical_no_updates_half_life.as_secs()) - .map(|decays| cmp::min(decays, u32::max_value() as u64) as u32) - .unwrap_or(u32::max_value()); + .map_or(u32::max_value(), |decays| cmp::min(decays, u32::max_value() as u64) as u32); // Rather than actually decaying the individual buckets, which would lose precision, we // simply track whether any buckets have data which wouldn't be decayed to zero, and if // there are none, treat it as if we had no data.