Skip to content

Commit

Permalink
Remove: unnecessary range checks
Browse files Browse the repository at this point in the history
  • Loading branch information
yn01-dev committed Dec 27, 2023
1 parent 0b6dc55 commit 10b1d80
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions src/LitMotion/Assets/LitMotion/Runtime/Internal/UpdateRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,26 @@ public unsafe void Update(float deltaTime, float unscaledDeltaTime)
var status = (dataPtr + i)->Status;
if (status == MotionStatus.Playing)
{
if (i < outputLength)
ref var callbacks = ref span[i];
try
{
callbacks.InvokeUnsafe(outputPtr[i]);
}
catch (Exception ex)
{
ref var callbacks = ref span[i];
try
{
callbacks.InvokeUnsafe(outputPtr[i]);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
Debug.LogException(ex);
}
}
else if (status == MotionStatus.Completed)
{
ref var callbacks = ref span[i];
if (i < outputLength)
try
{
try
{
callbacks.InvokeUnsafe(outputPtr[i]);
}
catch (Exception ex)
{
Debug.LogException(ex);
}
callbacks.InvokeUnsafe(outputPtr[i]);
}
catch (Exception ex)
{
Debug.LogException(ex);
}

try
Expand Down

0 comments on commit 10b1d80

Please sign in to comment.