summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArno den Hartog <ac.denhartog@student.maastrichtuniversity.nl>2016-04-27 05:03:27 +0200
committerArno den Hartog <ac.denhartog@student.maastrichtuniversity.nl>2016-04-27 05:03:27 +0200
commit24f68829749eb00fa0cdbd6624dcfa167e5c2ce9 (patch)
tree96b7a659cd3d06aa7bba506c42b6686a739afe05
parent93f209dd65d5c05fc2cb61916a850940499c9261 (diff)
downloadscala-24f68829749eb00fa0cdbd6624dcfa167e5c2ce9.tar.gz
scala-24f68829749eb00fa0cdbd6624dcfa167e5c2ce9.tar.bz2
scala-24f68829749eb00fa0cdbd6624dcfa167e5c2ce9.zip
Avoid function chaining with reverse method
-rw-r--r--src/library/scala/collection/mutable/PriorityQueue.scala4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/library/scala/collection/mutable/PriorityQueue.scala b/src/library/scala/collection/mutable/PriorityQueue.scala
index b4112c03dd..d5b7673c37 100644
--- a/src/library/scala/collection/mutable/PriorityQueue.scala
+++ b/src/library/scala/collection/mutable/PriorityQueue.scala
@@ -200,9 +200,7 @@ sealed class PriorityQueue[A](implicit val ord: Ordering[A])
* @return A reversed priority queue.
*/
def reverse = {
- val revq = new PriorityQueue[A]()(new scala.math.Ordering[A] {
- def compare(x: A, y: A) = ord.compare(y, x)
- })
+ val revq = new PriorityQueue[A]()(ord.reverse)
for (i <- 1 until resarr.length) revq += resarr(i)
revq
}