Skip to content

Commit

Permalink
Merge pull request #30619 from Givikap120/remove_unnecessary_field
Browse files Browse the repository at this point in the history
Remove field that's used only in one method
  • Loading branch information
smoogipoo authored Nov 14, 2024
2 parents 23167b0 + b086c27 commit 5fb1301
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions osu.Game.Rulesets.Osu/Difficulty/Skills/OsuStrainSkill.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ public abstract class OsuStrainSkill : StrainSkill
/// </summary>
protected virtual double ReducedStrainBaseline => 0.75;

protected double Difficulty;

protected OsuStrainSkill(Mod[] mods)
: base(mods)
{
}

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).
Expand All @@ -52,11 +50,11 @@ public override double DifficultyValue()
// 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;
Expand Down

0 comments on commit 5fb1301

Please sign in to comment.