diff --git a/util/collection/Util.scala b/util/collection/Util.scala index cceb1ec99..0b6b25118 100644 --- a/util/collection/Util.scala +++ b/util/collection/Util.scala @@ -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