mirror of https://github.com/sbt/sbt.git
Merge pull request #238 from xuwei-k/foldLeft
use foldLeft instead of /:
This commit is contained in:
commit
6e4ad6ebd4
|
|
@ -49,7 +49,7 @@ object ConflictWarning {
|
|||
if (differentFullNames.size > 1) differentFullNames else Set.empty[String]
|
||||
}
|
||||
}
|
||||
(Map.empty[(String, String), Set[String]] /: mismatches)(merge)
|
||||
mismatches.foldLeft(Map.empty[(String, String), Set[String]])(merge)
|
||||
}
|
||||
private[this] def merge[A, B](m: Map[A, Set[B]], b: (A, Set[B])): Map[A, Set[B]] =
|
||||
if (b._2.isEmpty) m
|
||||
|
|
|
|||
|
|
@ -774,7 +774,7 @@ private[sbt] object IvySbt {
|
|||
elem: scala.xml.Elem,
|
||||
extra: Map[String, String]
|
||||
): scala.xml.Elem =
|
||||
(elem /: extra) {
|
||||
extra.foldLeft(elem) {
|
||||
case (e, (key, value)) => e % new scala.xml.UnprefixedAttribute(key, value, scala.xml.Null)
|
||||
}
|
||||
private def hasInfo(module: ModuleID, x: scala.xml.NodeSeq) = {
|
||||
|
|
|
|||
|
|
@ -957,9 +957,9 @@ private[sbt] trait CachedResolutionResolveEngine extends ResolveEngine {
|
|||
}: _*)
|
||||
// This emulates test-internal extending test configuration etc.
|
||||
val remappedConfigs: Map[String, Vector[String]] =
|
||||
(remappedConfigs0 /: rootModuleConfs) { (acc0, c) =>
|
||||
rootModuleConfs.foldLeft(remappedConfigs0) { (acc0, c) =>
|
||||
val ps = parentConfigs(c.getName)
|
||||
(acc0 /: ps) { (acc, parent) =>
|
||||
ps.foldLeft(acc0) { (acc, parent) =>
|
||||
val vs0 = acc.getOrElse(c.getName, Vector())
|
||||
val vs = acc.getOrElse(parent, Vector())
|
||||
acc.updated(c.getName, (vs0 ++ vs).distinct)
|
||||
|
|
|
|||
Loading…
Reference in New Issue