From af79962c08c4f13123229d54913b734f62f3ef87 Mon Sep 17 00:00:00 2001 From: Givikap120 Date: Sat, 12 Oct 2024 19:08:20 +0300 Subject: [PATCH] fixed CI (again) --- osu.Game/Rulesets/Difficulty/Skills/StrainSkill.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Difficulty/Skills/StrainSkill.cs b/osu.Game/Rulesets/Difficulty/Skills/StrainSkill.cs index 32d09b08e3..7f74961068 100644 --- a/osu.Game/Rulesets/Difficulty/Skills/StrainSkill.cs +++ b/osu.Game/Rulesets/Difficulty/Skills/StrainSkill.cs @@ -130,19 +130,20 @@ namespace osu.Game.Rulesets.Difficulty.Skills // We're saving only the largest 200 strains int excessStrainsCount = savedSortedStrains.Count - MaxStrainCount; + if (MaxStrainCount > 0 && excessStrainsCount > 0) { savedSortedStrains.RemoveRange(savedSortedStrains.Count - excessStrainsCount, excessStrainsCount); } - var strainsWithCurrent = new SortedList((double a, double b) => { return a < b ? 1 : (a > b ? -1 : 0); }); + var strainsWithCurrent = new SortedList((a, b) => a < b ? 1 : (a > b ? -1 : 0)); strainsWithCurrent.AddRange(savedSortedStrains); strainsWithCurrent.Add(currentSectionPeak); return strainsWithCurrent; } - private SortedList savedSortedStrains = new SortedList((double a, double b) => { return a < b ? 1 : (a > b ? -1 : 0); }); - private int amountOfStrainsAddedSinceSave = 0; + private readonly SortedList savedSortedStrains = new SortedList((a, b) => a < b ? 1 : (a > b ? -1 : 0)); + private int amountOfStrainsAddedSinceSave; } }