mirror of
https://github.com/ppy/osu.git
synced 2025-02-05 02:03:04 +08:00
Merge pull request #27432 from EVAST9919/editor-effect-point-vis-alloc
Fix allocations in `EffectPointVisualisation`
This commit is contained in:
commit
dd3e4893b3
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
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.
|
// for changes. ControlPointInfo needs a refactor to make this flow better, but it should do for now.
|
||||||
Scheduler.AddDelayed(() =>
|
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))
|
if (!ReferenceEquals(nextControlPoint, next))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user