mirror of https://github.com/ppy/osu
Fix CI inspections / refactor to single enumeration
This commit is contained in:
parent
a682a823f4
commit
6afff72865
|
@ -122,16 +122,17 @@ private void load(OsuRulesetConfigManager config, IBeatmap beatmap)
|
|||
|
||||
RegisterPool<HitCircle, DrawableHitCircle>(20, 100);
|
||||
|
||||
// handle edge cases where a beatmap has a slider with many repeats.
|
||||
int maxRepeatsOnOneSlider = 0;
|
||||
int maxTicksOnOneSlider = 0;
|
||||
|
||||
var sliders = osuBeatmap?.HitObjects.OfType<Slider>();
|
||||
|
||||
if (sliders?.Any() == true)
|
||||
if (osuBeatmap != null)
|
||||
{
|
||||
// handle edge cases where a beatmap has a slider with many repeats.
|
||||
maxRepeatsOnOneSlider = sliders?.Max(s => s.RepeatCount) ?? 0;
|
||||
maxTicksOnOneSlider = sliders?.Max(s => s.NestedHitObjects.OfType<SliderTick>().Count()) ?? 0;
|
||||
foreach (var slider in osuBeatmap.HitObjects.OfType<Slider>())
|
||||
{
|
||||
maxRepeatsOnOneSlider = Math.Max(maxRepeatsOnOneSlider, slider.RepeatCount);
|
||||
maxTicksOnOneSlider = Math.Max(maxTicksOnOneSlider, slider.NestedHitObjects.OfType<SliderTick>().Count());
|
||||
}
|
||||
}
|
||||
|
||||
RegisterPool<Slider, DrawableSlider>(20, 100);
|
||||
|
|
Loading…
Reference in New Issue