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

Refactor.

This commit is contained in:
Cedric Beust 2016-07-29 01:43:54 -08:00
parent 3d91256eb6
commit f629b76658

View file

@ -58,10 +58,9 @@ enum class Scope(val scope: String, val dependencyLambda: (Project) -> List<ICla
fun toDependencyLambda(scopes: Collection<Scope>) : (Project) -> List<IClasspathDependency> { fun toDependencyLambda(scopes: Collection<Scope>) : (Project) -> List<IClasspathDependency> {
val result = { project : Project -> val result = { project : Project ->
scopes.fold(arrayListOf<IClasspathDependency>(), scopes.fold(arrayListOf<IClasspathDependency>(),
{ l: ArrayList<IClasspathDependency>, scope: Scope -> { list: ArrayList<IClasspathDependency>, scope: Scope ->
val deps = scope.dependencyLambda(project) list.addAll(scope.dependencyLambda(project))
l.addAll(deps) list
l
}) })
} }
return result return result