micro optimizations

This commit is contained in:
MaxOhn
2021-04-28 22:19:18 +02:00
parent 2707f1aabc
commit 643a67888d
5 changed files with 14 additions and 17 deletions
+2 -2
View File
@@ -50,8 +50,8 @@ pub(crate) struct HitObjectRhythm {
impl PartialEq for HitObjectRhythm {
#[inline]
fn eq(&self, other: &Self) -> bool {
(self.ratio - other.ratio).abs() < f32::EPSILON
&& (self.difficulty - other.difficulty).abs() < f32::EPSILON
(self.ratio - other.ratio).abs() <= f32::EPSILON
&& (self.difficulty - other.difficulty).abs() <= f32::EPSILON
}
}
+1 -1
View File
@@ -209,7 +209,7 @@ fn rescale(stars: f32) -> f32 {
if stars < 0.0 {
stars
} else {
10.43 * (stars / 8.0 + 1.0).ln()
10.43 * (stars / 8.0).ln_1p()
}
}
+1 -1
View File
@@ -150,7 +150,7 @@ impl SkillKind {
*current_strain *= RHYTHM_STRAIN_DECAY;
*notes_since_rhythm_change += 1;
if current.rhythm.difficulty.abs() < f32::EPSILON {
if current.rhythm.difficulty.abs() <= f32::EPSILON {
return 0.0;
}