Unrevert null-colaescing/conditionals removal

This commit is contained in:
Salman Ahmed 2021-05-07 09:53:54 +03:00
parent b1134c3857
commit 7c4e54a1d4
2 changed files with 3 additions and 8 deletions

View File

@ -307,11 +307,7 @@ namespace osu.Game.Screens.Edit
/// <summary>
/// If the beatmap's track has changed, this method must be called to keep the editor in a valid state.
/// </summary>
public void UpdateClockSource()
{
var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock();
clock.ChangeSource(sourceClock);
}
public void UpdateClockSource() => clock.ChangeSource(Beatmap.Value.Track);
protected void Save()
{
@ -582,7 +578,7 @@ namespace osu.Game.Screens.Edit
private void resetTrack(bool seekToStart = false)
{
Beatmap.Value.Track?.Stop();
Beatmap.Value.Track.Stop();
if (seekToStart)
{

View File

@ -4,7 +4,6 @@
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Input.Events;
using osu.Framework.Timing;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Screens.Edit;
@ -46,7 +45,7 @@ namespace osu.Game.Tests.Visual
private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> e)
{
Clock.ControlPointInfo = e.NewValue.Beatmap.ControlPointInfo;
Clock.ChangeSource((IAdjustableClock)e.NewValue.Track ?? new StopwatchClock());
Clock.ChangeSource(e.NewValue.Track);
Clock.ProcessFrame();
}