mirror of https://github.com/sbt/sbt.git
Simplify operations on collections
This commit is contained in:
parent
88b68c7fd0
commit
e528f3d163
|
|
@ -50,9 +50,9 @@ private[sbt] object JsonUtil {
|
|||
(c.caller.organization != sbtOrgTemp) &&
|
||||
(c.caller.organization != fakeCallerOrganization)
|
||||
}
|
||||
val interProj = (callers filter { c =>
|
||||
(c.caller.organization == sbtOrgTemp)
|
||||
}).headOption.toList
|
||||
val interProj = (callers find { c =>
|
||||
c.caller.organization == sbtOrgTemp
|
||||
}).toList
|
||||
interProj ::: nonArtificial.toList
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ class MakePom(val log: Logger) {
|
|||
val includeArtifacts = artifacts.filter(d => includeTypes(d.getType))
|
||||
if (artifacts.isEmpty) {
|
||||
val configs = dependency.getModuleConfigurations
|
||||
if (configs.filterNot(Set("sources", "docs")).nonEmpty) {
|
||||
if (!configs.forall(Set("sources", "docs"))) {
|
||||
warnIntransitve()
|
||||
val (scope, optional) = getScopeAndOptional(dependency.getModuleConfigurations)
|
||||
makeDependencyElem(dependency, scope, optional, None, None, excludes)
|
||||
|
|
@ -271,7 +271,7 @@ class MakePom(val log: Logger) {
|
|||
case Nil | "*" :: Nil => dependency.getModuleConfigurations
|
||||
case x => x.toArray
|
||||
}
|
||||
if (configs.filterNot(Set("sources", "docs")).nonEmpty) {
|
||||
if (!configs.forall(Set("sources", "docs"))) {
|
||||
val (scope, optional) = getScopeAndOptional(configs)
|
||||
val classifier = artifactClassifier(artifact)
|
||||
val baseType = artifactType(artifact)
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
|||
cs match {
|
||||
case Nil => Nil
|
||||
case (k, Vector()) :: rest => resolveConflicts(rest)
|
||||
case (k, Vector(oa)) :: rest if (oa.modules.size == 0) => resolveConflicts(rest)
|
||||
case (k, Vector(oa)) :: rest if (oa.modules.isEmpty) => resolveConflicts(rest)
|
||||
case (k, Vector(oa)) :: rest if (oa.modules.size == 1 && !oa.modules.head.evicted) =>
|
||||
log.debug(s":: no conflict $rootModuleConf: ${oa.organization}:${oa.name}")
|
||||
oa :: resolveConflicts(rest)
|
||||
|
|
|
|||
Loading…
Reference in New Issue