1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:23:22 +08:00

Use Enumerable.Repeat

This commit is contained in:
Henry Lin 2022-03-03 10:18:36 +08:00
parent d335a2229f
commit 55737226a3

View File

@ -69,7 +69,7 @@ namespace osu.Game.Rulesets.Mods
private ITrack track;
private HUDOverlay overlay;
private readonly List<double> recentRates = Enumerable.Range(0, average_count).Select(_ => 1d).ToList();
private readonly List<double> 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)