1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

Use if statements rather than conditional case

This commit is contained in:
Dean Herbert 2023-02-10 17:03:27 +09:00
parent 96c1832af4
commit 1df6fc6311

View File

@ -581,26 +581,18 @@ namespace osu.Game.Rulesets.Scoring
/// </summary>
public static ScoreRank RankFromAccuracy(double accuracy)
{
switch (accuracy)
{
case accuracy_cutoff_x:
return ScoreRank.X;
if (accuracy == accuracy_cutoff_x)
return ScoreRank.X;
if (accuracy >= accuracy_cutoff_s)
return ScoreRank.S;
if (accuracy >= accuracy_cutoff_a)
return ScoreRank.A;
if (accuracy >= accuracy_cutoff_b)
return ScoreRank.B;
if (accuracy >= accuracy_cutoff_c)
return ScoreRank.C;
case >= accuracy_cutoff_s:
return ScoreRank.S;
case >= accuracy_cutoff_a:
return ScoreRank.A;
case >= accuracy_cutoff_b:
return ScoreRank.B;
case >= accuracy_cutoff_c:
return ScoreRank.C;
default:
return ScoreRank.D;
}
return ScoreRank.D;
}
/// <summary>