1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Simplify.

This commit is contained in:
Cedric Beust 2016-04-12 23:35:24 -07:00
parent abc45bb8c5
commit 63da02d5f5

View file

@ -97,17 +97,8 @@ public class TaskManager @Inject constructor(val args: Args, val incrementalMana
log(1, "About to run graph:\n ${graph.dump()} ")
val factory = object : IThreadWorkerFactory<PluginTask> {
override public fun createWorkers(nodes: List<PluginTask>): List<IWorker<PluginTask>> {
// val tr = nodes.reduce { workers: List<TaskWorker>, node: PluginTask ->
// val result: List<TaskWorker> = workers + TaskWorker(listOf(node), args.dryRun, messages)
// result
// }
val thisResult = arrayListOf<IWorker<PluginTask>>()
nodes.forEach {
thisResult.add(TaskWorker(listOf(it), args.dryRun, messages))
}
return thisResult
}
override fun createWorkers(nodes: List<PluginTask>)
= nodes.map { TaskWorker(listOf(it), args.dryRun, messages) }
}
val executor = DynamicGraphExecutor(graph, factory)