Skip to content

Commit

Permalink
Remove unnecessary UnbindAdjustments call
Browse files Browse the repository at this point in the history
It is not necessary given that `CurrentTrack` already removes all adjustments first.
  • Loading branch information
frenzibyte committed May 10, 2022
1 parent 36a7644 commit 9446be2
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions osu.Game/Overlays/MusicController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,21 +393,11 @@ public void ResetTrackAdjustments()
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);
}
}
Expand Down

0 comments on commit 9446be2

Please sign in to comment.