From 63da02d5f5339343c2dc20887f2d2ef3d0a76c2c Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Tue, 12 Apr 2016 23:35:24 -0700 Subject: [PATCH] Simplify. --- .../kotlin/com/beust/kobalt/internal/TaskManager.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt index 8592046e..ddaaaf92 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt @@ -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 { - override public fun createWorkers(nodes: List): List> { -// val tr = nodes.reduce { workers: List, node: PluginTask -> -// val result: List = workers + TaskWorker(listOf(node), args.dryRun, messages) -// result -// } - val thisResult = arrayListOf>() - nodes.forEach { - thisResult.add(TaskWorker(listOf(it), args.dryRun, messages)) - } - return thisResult - } + override fun createWorkers(nodes: List) + = nodes.map { TaskWorker(listOf(it), args.dryRun, messages) } } val executor = DynamicGraphExecutor(graph, factory)