diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-29 19:34:21 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-29 19:34:21 +0000 |
commit | 6c22499c40afdb6c2bd27618b30688a7f96f1c41 (patch) | |
tree | 4463097a2661d4a020346a5f7a1e44ae662c5e35 /docs/examples | |
parent | bcf53cbe913a99bb243b5782da644cf0efecc598 (diff) | |
download | scala-6c22499c40afdb6c2bd27618b30688a7f96f1c41.tar.gz scala-6c22499c40afdb6c2bd27618b30688a7f96f1c41.tar.bz2 scala-6c22499c40afdb6c2bd27618b30688a7f96f1c41.zip |
Fix bug in example sort.
Embarrassing bug causes sort to explode if there are any duplicated
elements. Closes SI-4961, no review.
Diffstat (limited to 'docs/examples')
-rw-r--r-- | docs/examples/sort2.scala | 4 |
1 files 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)) } |