diff options
author | Paul Phillips <paulp@improving.org> | 2011-08-27 18:02:20 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-08-27 18:02:20 +0000 |
commit | f0b042b33558345d815ca926360b8071b92461aa (patch) | |
tree | 81aaa5c8bf71f5ccdc0aa29d1f720fd65c54acf4 | |
parent | 2c548eac23014bff46f563dd4fdfd65bc7aaa54c (diff) | |
download | scala-f0b042b33558345d815ca926360b8071b92461aa.tar.gz scala-f0b042b33558345d815ca926360b8071b92461aa.tar.bz2 scala-f0b042b33558345d815ca926360b8071b92461aa.zip |
Fixing up a few instances of suboptimal reversi...
Fixing up a few instances of suboptimal reversing, no review.
4 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala index 03f08dbddd..56e05cdc04 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/BasicBlocks.scala @@ -94,7 +94,7 @@ trait BasicBlocks { /** Return an iterator over the instructions in this basic block. */ def iterator: Iterator[Instruction] = - if (closed) instrs.iterator else instructionList.reverse.iterator + if (closed) instrs.iterator else instructionList.reverseIterator /** return the underlying array of instructions */ def getArray: Array[Instruction] = { diff --git a/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala b/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala index e0d51aee16..3e921cf472 100644 --- a/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala +++ b/src/compiler/scala/tools/nsc/backend/opt/ClosureElimination.scala @@ -232,7 +232,7 @@ abstract class ClosureElimination extends SubComponent { while (t != Nil) { peep(b, h, t.head) match { case Some(newInstrs) => - newInstructions = seen.reverse ::: newInstrs ::: t.tail; + newInstructions = seen reverse_::: newInstrs ::: t.tail redo = true case None => () diff --git a/src/library/scala/collection/immutable/Queue.scala b/src/library/scala/collection/immutable/Queue.scala index 813497f994..c1db8b4851 100644 --- a/src/library/scala/collection/immutable/Queue.scala +++ b/src/library/scala/collection/immutable/Queue.scala @@ -99,7 +99,7 @@ class Queue[+A] protected(protected val in: List[A], protected val out: List[A]) * @param iter an iterable object */ def enqueue[B >: A](iter: Iterable[B]) = - new Queue(iter.toList.reverse ::: in, out) + new Queue(iter.toList reverse_::: in, out) /** Returns a tuple with the first element in the queue, * and a new queue with this element removed. diff --git a/src/library/scala/collection/mutable/ArrayStack.scala b/src/library/scala/collection/mutable/ArrayStack.scala index 23af7d481e..1cb44e55d5 100644 --- a/src/library/scala/collection/mutable/ArrayStack.scala +++ b/src/library/scala/collection/mutable/ArrayStack.scala @@ -22,7 +22,7 @@ object ArrayStack extends SeqFactory[ArrayStack] { def newBuilder[A]: Builder[A, ArrayStack[A]] = new ArrayStack[A] def empty: ArrayStack[Nothing] = new ArrayStack() def apply[A: ClassManifest](elems: A*): ArrayStack[A] = { - val els: Array[AnyRef] = elems.reverse.map{_.asInstanceOf[AnyRef]}(breakOut) + val els: Array[AnyRef] = elems.reverseMap(_.asInstanceOf[AnyRef])(breakOut) if (els.length == 0) new ArrayStack() else new ArrayStack[A](els, els.length) } |