1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-23 02:39:52 +08:00

Merge pull request #30619 from Givikap120/remove_unnecessary_field

Remove field that's used only in one method
This commit is contained in:
Dan Balasescu
2024-11-14 17:42:18 +09:00
committed by GitHub
Unverified
@@ -23,8 +23,6 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
/// </summary>
protected virtual double ReducedStrainBaseline => 0.75;
protected double Difficulty;
protected OsuStrainSkill(Mod[] mods)
: base(mods)
{
@@ -32,7 +30,7 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
public override double DifficultyValue()
{
Difficulty = 0;
double difficulty = 0;
double weight = 1;
// Sections with 0 strain are excluded to avoid worst-case time complexity of the following sort (e.g. /b/2351871).
@@ -52,11 +50,11 @@ namespace osu.Game.Rulesets.Osu.Difficulty.Skills
// We're sorting from highest to lowest strain.
foreach (double strain in strains.OrderDescending())
{
Difficulty += strain * weight;
difficulty += strain * weight;
weight *= DecayWeight;
}
return Difficulty;
return difficulty;
}
public static double DifficultyToPerformance(double difficulty) => Math.Pow(5.0 * Math.Max(1.0, difficulty / 0.0675) - 4.0, 3.0) / 100000.0;