diff options
Diffstat (limited to 'test/benchmark/sources/sort1/sort1.scala')
-rw-r--r-- | test/benchmark/sources/sort1/sort1.scala | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/test/benchmark/sources/sort1/sort1.scala b/test/benchmark/sources/sort1/sort1.scala deleted file mode 100644 index 6795158a78..0000000000 --- a/test/benchmark/sources/sort1/sort1.scala +++ /dev/null @@ -1,28 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala benchmark suite ** -** / __/ __// _ | / / / _ | (c) 2003-2004, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -** $Id$ -\* */ - - -package benchmarks; - -/** Quick sort with a functional taste. */ -object sort1 with scala.testing.Benchmark { - - def sort(a: List[Int]): List[Int] = { - if (a.length < 2) - a - else { - val pivot = a(a.length / 2); - sort(a.filter(x => x < pivot)) - ::: a.filter(x => x == pivot) - ::: sort(a.filter(x => x > pivot)) - } - } - - def run: Unit = sort(List.range(1, 10000)); -} |