This repository was archived by the owner on Nov 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
kotlinx-coroutines-core/common/test/flow
kotlinx-coroutines-test/src/internal Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ internal class VirtualTimeDispatcher(enclosingScope: CoroutineScope) : Coroutine
26
26
? : error(" Event loop is missing, virtual time source works only as part of event loop" )
27
27
if (delayNanos <= 0 ) continue
28
28
if (delayNanos > 0 && delayNanos != Long .MAX_VALUE ) error(" Unexpected external delay: $delayNanos " )
29
- val nextTask = heap.minBy { it.deadline } ? : return @launch
29
+ val nextTask = heap.minByOrNull { it.deadline } ? : return @launch
30
30
heap.remove(nextTask)
31
31
currentTime = nextTask.deadline
32
32
nextTask.run ()
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ internal class TestMainDispatcherFactory : MainDispatcherFactory {
64
64
override fun createDispatcher (allFactories : List <MainDispatcherFactory >): MainCoroutineDispatcher {
65
65
val originalFactory = allFactories.asSequence()
66
66
.filter { it != = this }
67
- .maxBy { it.loadPriority } ? : MissingMainCoroutineDispatcherFactory
67
+ .maxByOrNull { it.loadPriority } ? : MissingMainCoroutineDispatcherFactory
68
68
return TestMainDispatcher (originalFactory)
69
69
}
70
70
You can’t perform that action at this time.
0 commit comments