From 568fe3dc471f2fb3b056a78c3a983e3edf6dd7eb Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Mon, 26 Sep 2011 08:20:07 -0400 Subject: [PATCH] fix order of returned lists in Util.separate --- util/collection/Util.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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