merge upstream/unstable

This commit is contained in:
Mark Mackey
2022-12-28 14:43:25 -06:00
37 changed files with 112 additions and 122 deletions

View File

@@ -186,14 +186,7 @@ impl RealScore {
/// Add an f64 to the score abiding by the limits.
fn add(&mut self, score: f64) {
let mut new_score = self.lighthouse_score + score;
if new_score > MAX_SCORE {
new_score = MAX_SCORE;
}
if new_score < MIN_SCORE {
new_score = MIN_SCORE;
}
let new_score = (self.lighthouse_score + score).clamp(MIN_SCORE, MAX_SCORE);
self.set_lighthouse_score(new_score);
}