Permalink
Browse files

Fix bug in example sort.

Embarrassing bug causes sort to explode if there are any duplicated
elements. Closes SI-4961, no review.
  • Loading branch information...
paulp committed Oct 29, 2011
1 parent bcf53cb commit 6c22499c40afdb6c2bd27618b30688a7f96f1c41
Showing with 2 additions and 2 deletions.
  1. +2 −2 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))
}

0 comments on commit 6c22499

Please sign in to comment.