From 0e5b571590ae5708928a14828d98d9b11a8427b7 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 21 Mar 2021 02:02:11 +0100 Subject: [PATCH] cleanup --- Coroutine/CoroutineHandlerInstance.cs | 2 +- Tests/EventBasedCoroutineTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Coroutine/CoroutineHandlerInstance.cs b/Coroutine/CoroutineHandlerInstance.cs index 87f063a..aba2f9b 100644 --- a/Coroutine/CoroutineHandlerInstance.cs +++ b/Coroutine/CoroutineHandlerInstance.cs @@ -132,7 +132,7 @@ namespace Coroutine { var coroutines = this.GetOutstandingCoroutines(evt); if (coroutines.Count > 0) { coroutines.RemoveWhere(c => { - var list = c.IsWaitingForEvent ? this.GetEventCoroutines(c.Event, true) : this.tickingCoroutines; + var list = evt ? this.GetEventCoroutines(c.Event, true) : this.tickingCoroutines; var position = list.BinarySearch(c); list.Insert(position < 0 ? ~position : position, c); return true; diff --git a/Tests/EventBasedCoroutineTests.cs b/Tests/EventBasedCoroutineTests.cs index dcdd6cd..456f9c9 100644 --- a/Tests/EventBasedCoroutineTests.cs +++ b/Tests/EventBasedCoroutineTests.cs @@ -268,7 +268,7 @@ namespace Tests { CoroutineHandler.RaiseEvent(myEvent); Assert.AreEqual(1, counterShouldExecuteAfter, $"ShouldExecuteAfter counter {counterShouldExecuteAfter} is invalid."); Assert.AreEqual(1, counterShouldExecuteFinally, $"ShouldExecuteFinally counter {counterShouldExecuteFinally} is invalid."); - + before1.Cancel(); after.Cancel(); before0.Cancel();