Fix CI inspections / refactor to single enumeration

This commit is contained in:
Dan Balasescu 2022-08-05 20:54:10 +09:00
parent a682a823f4
commit 6afff72865
1 changed files with 7 additions and 6 deletions

View File

@ -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);