mirror of https://github.com/sbt/sbt.git
fix order of returned lists in Util.separate
This commit is contained in:
parent
a2e30494fe
commit
568fe3dc47
|
|
@ -6,7 +6,10 @@ package sbt
|
|||
object Util
|
||||
{
|
||||
def separate[T,A,B](ps: Seq[T])(f: T => Either[A,B]): (Seq[A], Seq[B]) =
|
||||
((Nil: Seq[A], Nil: Seq[B]) /: ps)( (xs, y) => prependEither(xs, f(y)) )
|
||||
{
|
||||
val (a,b) = ((Nil: Seq[A], Nil: Seq[B]) /: ps)( (xs, y) => prependEither(xs, f(y)) )
|
||||
(a.reverse, b.reverse)
|
||||
}
|
||||
|
||||
def prependEither[A,B](acc: (Seq[A], Seq[B]), next: Either[A,B]): (Seq[A], Seq[B]) =
|
||||
next match
|
||||
|
|
|
|||
Loading…
Reference in New Issue