mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
merge upstream, fix compile errors
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user