From 0714a4fc1e23a4a3e7672ff7a075fe86d6878194 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Feb 2024 03:18:50 +0800 Subject: [PATCH] Revert sample lookup logic that was not allocating anything --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 8a87e17089..900f42d96b 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -252,23 +252,8 @@ namespace osu.Game.Rulesets.Osu.Objects protected void UpdateNestedSamples() { - HitSampleInfo firstSample = null; - - for (int i = 0; i < Samples.Count; i++) - { - // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933) - if (i == 0) - { - firstSample = Samples[i]; - continue; - } - - if (Samples[i].Name != HitSampleInfo.HIT_NORMAL) - continue; - - firstSample = Samples[i]; - break; - } + var firstSample = Samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL) + ?? Samples.FirstOrDefault(); // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933) var sampleList = new List();