micro optimizations
This commit is contained in:
@@ -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
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user