1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 01:02:56 +08:00

Remove unnecessary UnbindAdjustments call

It is not necessary given that `CurrentTrack` already removes all adjustments first.
This commit is contained in:
Salman Ahmed 2022-05-10 20:49:15 +03:00
parent 36a7644164
commit 9446be2511

View File

@ -393,21 +393,11 @@ namespace osu.Game.Overlays
CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Tempo);
CurrentTrack.RemoveAllAdjustments(AdjustableProperty.Volume);
var applicableToTrack = mods.Value.OfType<IApplicableToTrack>();
if (!allowTrackAdjustments || !applicableToTrack.Any())
{
if (modTrackAdjustments != null)
{
CurrentTrack.UnbindAdjustments(modTrackAdjustments);
modTrackAdjustments = null;
}
}
else
if (allowTrackAdjustments)
{
CurrentTrack.BindAdjustments(modTrackAdjustments = new AudioAdjustments());
foreach (var mod in applicableToTrack)
foreach (var mod in mods.Value.OfType<IApplicableToTrack>())
mod.ApplyToTrack(modTrackAdjustments);
}
}