mirror of https://github.com/sbt/sbt.git
Minor cleanups in SbtUpdateReport (#189)
Use Seq.unapplySeq over .size/.head. Drop now unnecessary toVector's.
This commit is contained in:
parent
0849574331
commit
6157bff6d7
|
|
@ -288,11 +288,10 @@ private[internal] object SbtUpdateReport {
|
||||||
classpathOrder = classpathOrder,
|
classpathOrder = classpathOrder,
|
||||||
)
|
)
|
||||||
|
|
||||||
val reports0 =
|
val reports0 = subRes.rootDependencies match {
|
||||||
if (subRes.rootDependencies.size == 1) {
|
case Seq(dep) =>
|
||||||
// quick hack ensuring the module for the only root dependency
|
// quick hack ensuring the module for the only root dependency
|
||||||
// appears first in the update report, see https://github.com/coursier/coursier/issues/650
|
// appears first in the update report, see https://github.com/coursier/coursier/issues/650
|
||||||
val dep = subRes.rootDependencies.head
|
|
||||||
val (_, proj) = subRes.projectCache(dep.moduleVersion)
|
val (_, proj) = subRes.projectCache(dep.moduleVersion)
|
||||||
val mod = moduleId((dep, proj.version, infoProperties(proj).toMap))
|
val mod = moduleId((dep, proj.version, infoProperties(proj).toMap))
|
||||||
val (main, other) = reports.partition { r =>
|
val (main, other) = reports.partition { r =>
|
||||||
|
|
@ -300,9 +299,9 @@ private[internal] object SbtUpdateReport {
|
||||||
r.module.name == mod.name &&
|
r.module.name == mod.name &&
|
||||||
r.module.crossVersion == mod.crossVersion
|
r.module.crossVersion == mod.crossVersion
|
||||||
}
|
}
|
||||||
main.toVector ++ other.toVector
|
main ++ other
|
||||||
} else
|
case _ => reports
|
||||||
reports.toVector
|
}
|
||||||
|
|
||||||
val mainReportDetails = reports0.map { rep =>
|
val mainReportDetails = reports0.map { rep =>
|
||||||
OrganizationArtifactReport(rep.module.organization, rep.module.name, Vector(rep))
|
OrganizationArtifactReport(rep.module.organization, rep.module.name, Vector(rep))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue