mirror of
https://github.com/Cysharp/UniTask.git
synced 2026-05-16 03:50:11 +00:00
Optimize ContinuationQueue and PlayerLoopRunner iteration
- Fix failing to eliminate array bounds check in PlayerLoopRunner.RunCore - Reduce number of array bounds check of continuation iteration in ContinuationQueue.RunCore
This commit is contained in:
@@ -170,8 +170,8 @@ namespace Cysharp.Threading.Tasks.Internal
|
||||
|
||||
for (int i = 0; i < actionListCount; i++)
|
||||
{
|
||||
var action = actionList[i];
|
||||
actionList[i] = null;
|
||||
|
||||
ref var action = ref actionList[i];//Reduce array bounds check
|
||||
|
||||
try
|
||||
{
|
||||
@@ -181,6 +181,7 @@ namespace Cysharp.Threading.Tasks.Internal
|
||||
{
|
||||
UnityEngine.Debug.LogException(ex);
|
||||
}
|
||||
action = null;
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -143,6 +143,7 @@ namespace Cysharp.Threading.Tasks.Internal
|
||||
{
|
||||
var j = tail - 1;
|
||||
|
||||
var loopItems = this.loopItems;
|
||||
// eliminate array-bound check for i
|
||||
for (int i = 0; i < loopItems.Length; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user