mirror of https://github.com/ppy/osu
Use debug.assert for better readable.
This commit is contained in:
parent
0a1543c6e8
commit
8c2f4b48fc
|
@ -9,7 +9,6 @@
|
|||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Development;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Beatmaps;
|
||||
|
@ -189,7 +188,10 @@ public void HandleFrame(ReplayFrame frame) => Schedule(() =>
|
|||
}
|
||||
|
||||
if (frame is IConvertibleReplayFrame convertible)
|
||||
pendingFrames.Enqueue(convertible.ToLegacy(currentBeatmap.AsNonNull()));
|
||||
{
|
||||
Debug.Assert(currentBeatmap != null);
|
||||
pendingFrames.Enqueue(convertible.ToLegacy(currentBeatmap));
|
||||
}
|
||||
|
||||
if (pendingFrames.Count > max_pending_frames)
|
||||
purgePendingFrames();
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Extensions;
|
||||
|
@ -144,7 +144,8 @@ private LegacyReplayFrame getLegacyFrame(ReplayFrame replayFrame)
|
|||
return legacyFrame;
|
||||
|
||||
case IConvertibleReplayFrame convertibleFrame:
|
||||
return convertibleFrame.ToLegacy(beatmap.AsNonNull());
|
||||
Debug.Assert(beatmap != null);
|
||||
return convertibleFrame.ToLegacy(beatmap);
|
||||
|
||||
default:
|
||||
throw new ArgumentException(@"Frame could not be converted to legacy frames", nameof(replayFrame));
|
||||
|
|
Loading…
Reference in New Issue