mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
simplify array initializationstatement
This commit is contained in:
parent
ac202ba7ea
commit
a440d15620
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Catch.Mods
|
|||||||
string overallDifficulty = OverallDifficulty.IsDefault ? "" : $"OD {OverallDifficulty.Value}";
|
string overallDifficulty = OverallDifficulty.IsDefault ? "" : $"OD {OverallDifficulty.Value}";
|
||||||
string approachRate = ApproachRate.IsDefault ? "" : $"AR {ApproachRate.Value}";
|
string approachRate = ApproachRate.IsDefault ? "" : $"AR {ApproachRate.Value}";
|
||||||
|
|
||||||
string[] settings = new string[] { circleSize, drainRate, overallDifficulty, approachRate };
|
string[] settings = { circleSize, drainRate, overallDifficulty, approachRate };
|
||||||
// filter out empty strings so we don't have orphaned commas
|
// filter out empty strings so we don't have orphaned commas
|
||||||
settings = Array.FindAll(settings, s => !string.IsNullOrEmpty(s));
|
settings = Array.FindAll(settings, s => !string.IsNullOrEmpty(s));
|
||||||
return string.Join(", ", settings);
|
return string.Join(", ", settings);
|
||||||
|
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
string overallDifficulty = OverallDifficulty.IsDefault ? "" : $"OD {OverallDifficulty.Value}";
|
string overallDifficulty = OverallDifficulty.IsDefault ? "" : $"OD {OverallDifficulty.Value}";
|
||||||
string approachRate = ApproachRate.IsDefault ? "" : $"AR {ApproachRate.Value}";
|
string approachRate = ApproachRate.IsDefault ? "" : $"AR {ApproachRate.Value}";
|
||||||
|
|
||||||
string[] settings = new string[] { circleSize, drainRate, overallDifficulty, approachRate };
|
string[] settings = { circleSize, drainRate, overallDifficulty, approachRate };
|
||||||
// filter out empty strings so we don't have orphaned commas
|
// filter out empty strings so we don't have orphaned commas
|
||||||
settings = Array.FindAll(settings, s => !string.IsNullOrEmpty(s));
|
settings = Array.FindAll(settings, s => !string.IsNullOrEmpty(s));
|
||||||
return string.Join(", ", settings);
|
return string.Join(", ", settings);
|
||||||
|
Loading…
Reference in New Issue
Block a user