fix broken loop-runner from 2.0.32, #172

pull/183/head
neuecc 2020-09-21 11:42:02 +09:00
parent 2bf9f4f062
commit 5d4a90e9bd
2 changed files with 11 additions and 2 deletions

View File

@ -143,8 +143,6 @@ 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++)
{
var action = loopItems[i];

View File

@ -200,5 +200,16 @@ namespace Cysharp.Threading.TasksTests
okay1.Should().Be(true);
okay2.Should().Be(true);
});
[UnityTest]
public IEnumerator LoopTest() => UniTask.ToCoroutine(async () =>
{
for (int i = 0; i < 20; ++i)
{
UniTask.DelayFrame(100).Forget();
await UniTask.DelayFrame(1);
}
});
}
}