Skip to content

Commit

Permalink
Replace if with assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
saul committed Feb 25, 2024
1 parent 38fcfb3 commit ef61726
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/DemoFile/DemoParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,7 @@ private async ValueTask<bool> MoveNextCoreAsync(EDemoCommands msgType, bool isCo
{
IsReading = true;

if (msgType is < 0 or >= EDemoCommands.DemMax)
throw new InvalidDemoException($"Unexpected demo command: {msgType}");
Debug.Assert(msgType is >= 0 and < EDemoCommands.DemMax, $"Unexpected demo command: {msgType}");

while (_demoTickTimers.TryPeek(out var timer, out var timerTick) && timerTick <= CurrentDemoTick.Value)
{
Expand Down

0 comments on commit ef61726

Please sign in to comment.