summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/LinearSeqLike.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-03-11 12:13:58 +0000
committerPaul Phillips <paulp@improving.org>2011-03-11 12:13:58 +0000
commitbe49752855a1a6997d4112eeff351e1c119a8a93 (patch)
treeee2cef3642b675420d47ff30bda9ddb2b74f1c30 /src/library/scala/collection/LinearSeqLike.scala
parent67c461b2d9c19d51e40e1f3ff23455cead1413b5 (diff)
downloadscala-be49752855a1a6997d4112eeff351e1c119a8a93.tar.gz
scala-be49752855a1a6997d4112eeff351e1c119a8a93.tar.bz2
scala-be49752855a1a6997d4112eeff351e1c119a8a93.zip
A patch for views. Most relevant change:
Almost all view classes now list parents like trait Appended[B >: A] extends super.Appended[B] with Transformed[B] instead of the former trait Appended[B >: A] extends Transformed[B] with super.Appended[B] because as it was, the implementation of foreach in TraversableViewLike#Transformed was repeatedly trumping overrides found in e.g. IterableLike. This change was not without its own consequences, and much of the rest of the patch is dealing with that. A more general issue is clearly revealed here: there is no straightforward way to deal with trait composition and overrides when some methods should prefer B over A and some the reverse. (It's more like A through Z in this case.) That closes #4279, with some views being five orders of magnitude slower than necessary. There is a test that confirms they'll stay performance neighbors. In the view classes (Zipped, Mapped, etc.) I attended to them with comb and brush until they were reasonably consistent. I only use "override" where necessary and throw in some "final" in the interests of trying to anchor the composition outcome. I also switched the newSliced, newZipped, etc. methods to use early init syntax since a number have abstract vals and I found at least one bug originating with uninitialized access. There was a piece of a parallel collections scalacheck test failing, which I disabled out of expedience - am emailing prokopec. There is plenty of work left to do but paulp must get back to other 2.9 issues. This is the Zurich->SF airplane patch. No review.
Diffstat (limited to 'src/library/scala/collection/LinearSeqLike.scala')
-rw-r--r--src/library/scala/collection/LinearSeqLike.scala5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/library/scala/collection/LinearSeqLike.scala b/src/library/scala/collection/LinearSeqLike.scala
index 6d346f3fe0..068c63432f 100644
--- a/src/library/scala/collection/LinearSeqLike.scala
+++ b/src/library/scala/collection/LinearSeqLike.scala
@@ -18,8 +18,7 @@ import scala.util.control.Breaks._
*
* $linearSeqInfo
*
- * This trait just implements `iterator`
- * in terms of `isEmpty, ``head`, and `tail`.
+ * This trait just implements `iterator` in terms of `isEmpty, ``head`, and `tail`.
* However, see `LinearSeqOptimized` for an implementation trait that overrides operations
* to make them run faster under the assumption of fast linear access with `head` and `tail`.
*
@@ -56,7 +55,7 @@ trait LinearSeqLike[+A, +Repr <: LinearSeqLike[A, Repr]] extends SeqLike[A, Repr
val result = these.head; these = these.tail; result
} else Iterator.empty.next
- /** Have to clear these so the iterator is exhausted like
+ /** Have to clear `these` so the iterator is exhausted like
* it would be without the optimization.
*/
override def toList: List[A] = {