--- a/src/Pure/library.scala Fri Sep 02 12:29:06 2016 +0200
+++ b/src/Pure/library.scala Fri Sep 02 16:23:02 2016 +0200
@@ -188,10 +188,10 @@
def remove[A, B](x: B)(xs: List[A]): List[A] = if (member(xs)(x)) xs.filterNot(_ == x) else xs
def update[A](x: A)(xs: List[A]): List[A] = x :: remove(x)(xs)
- def distinct[A](xs: List[A], eq: (A, A) => Boolean = (x: A, y: A) => x == y): List[A] =
+ def distinct[A](xs: List[A]): List[A] =
{
val result = new mutable.ListBuffer[A]
- for (x <- xs if !result.exists(y => eq(x, y))) result += x
+ xs.foreach(x => if (!result.contains(x)) result += x)
result.toList
}
}