From 55737226a31ba2f190abeb88953a99e6d704be54 Mon Sep 17 00:00:00 2001 From: Henry Lin Date: Thu, 3 Mar 2022 10:18:36 +0800 Subject: [PATCH] Use `Enumerable.Repeat` --- osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs b/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs index 7c92bd8141..f155005f67 100644 --- a/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs +++ b/osu.Game/Rulesets/Mods/ModAdaptiveSpeed.cs @@ -69,7 +69,7 @@ namespace osu.Game.Rulesets.Mods private ITrack track; private HUDOverlay overlay; - private readonly List recentRates = Enumerable.Range(0, average_count).Select(_ => 1d).ToList(); + private readonly List recentRates = Enumerable.Repeat(1d, average_count).ToList(); // rate for a hit is calculated using the end time of another hit object earlier in time // caching them here for easy access @@ -98,7 +98,7 @@ namespace osu.Game.Rulesets.Mods InitialRate.TriggerChange(); AdjustPitch.TriggerChange(); recentRates.Clear(); - recentRates.AddRange(Enumerable.Range(0, average_count).Select(_ => InitialRate.Value)); + recentRates.AddRange(Enumerable.Repeat(InitialRate.Value, average_count)); } public void ApplyToSample(DrawableSample sample)