mirror of https://github.com/sbt/sbt.git
Remove redundant collection conversions
This commit is contained in:
parent
345cceafe6
commit
c1de41f5c0
|
|
@ -52,7 +52,7 @@ object IMap {
|
|||
put(k, f(this get k getOrElse init))
|
||||
|
||||
def mapValues[V2[_]](f: V ~> V2) =
|
||||
new IMap0[K, V2](backing.mapValues(x => f(x)).toMap)
|
||||
new IMap0[K, V2](backing.mapValues(x => f(x)))
|
||||
|
||||
def mapSeparate[VL[_], VR[_]](f: V ~> ({ type l[T] = Either[VL[T], VR[T]] })#l) =
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ sealed trait Settings[Scope] {
|
|||
}
|
||||
|
||||
private final class Settings0[Scope](val data: Map[Scope, AttributeMap], val delegates: Scope => Seq[Scope]) extends Settings[Scope] {
|
||||
def scopes: Set[Scope] = data.keySet.toSet
|
||||
def scopes: Set[Scope] = data.keySet
|
||||
def keys(scope: Scope) = data(scope).keys.toSet
|
||||
def allKeys[T](f: (Scope, AttributeKey[_]) => T): Seq[T] = data.flatMap { case (scope, map) => map.keys.map(k => f(scope, k)) } toSeq;
|
||||
def allKeys[T](f: (Scope, AttributeKey[_]) => T): Seq[T] = data.flatMap { case (scope, map) => map.keys.map(k => f(scope, k)) } toSeq
|
||||
|
||||
def get[T](scope: Scope, key: AttributeKey[T]): Option[T] =
|
||||
delegates(scope).toStream.flatMap(sc => getDirect(sc, key)).headOption
|
||||
|
|
|
|||
Loading…
Reference in New Issue