From 6c22499c40afdb6c2bd27618b30688a7f96f1c41 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 29 Oct 2011 19:34:21 +0000 Subject: Fix bug in example sort. Embarrassing bug causes sort to explode if there are any duplicated elements. Closes SI-4961, no review. --- docs/examples/sort2.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/sort2.scala b/docs/examples/sort2.scala index 8e0b070250..e0016088bb 100644 --- a/docs/examples/sort2.scala +++ b/docs/examples/sort2.scala @@ -11,13 +11,13 @@ object sort2 { def gtPivot(x: Int) = x > pivot def eqPivot(x: Int) = x == pivot sort(a filter lePivot) ::: - sort(a filter eqPivot) ::: + (a filter eqPivot) ::: sort(a filter gtPivot) } } def main(args: Array[String]) { - val xs = List(6, 2, 8, 5, 1) + val xs = List(6, 2, 8, 5, 1, 8) println(xs) println(sort(xs)) } -- cgit v1.2.3