1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 19:27:24 +08:00

Merge pull request #27432 from EVAST9919/editor-effect-point-vis-alloc

Fix allocations in `EffectPointVisualisation`
This commit is contained in:
Salman Ahmed 2024-03-01 01:17:39 +03:00 committed by GitHub
commit dd3e4893b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
@ -53,7 +52,18 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
// for changes. ControlPointInfo needs a refactor to make this flow better, but it should do for now.
Scheduler.AddDelayed(() =>
{
var next = beatmap.ControlPointInfo.EffectPoints.FirstOrDefault(c => c.Time > effect.Time);
EffectControlPoint? next = null;
for (int i = 0; i < beatmap.ControlPointInfo.EffectPoints.Count; i++)
{
var point = beatmap.ControlPointInfo.EffectPoints[i];
if (point.Time > effect.Time)
{
next = point;
break;
}
}
if (!ReferenceEquals(nextControlPoint, next))
{