diff options
author | Paul Phillips <paulp@improving.org> | 2010-12-04 07:55:49 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-12-04 07:55:49 +0000 |
commit | 1a45bc7f19a56bd7959a496f617b501d1eae7513 (patch) | |
tree | 0720d9e9b17414ced6c02bbdea147fb18062e5b6 /src/library/scala/collection/LinearSeqOptimized.scala | |
parent | 9e9914e109c91cd4f86802129c236827517d8386 (diff) | |
download | scala-1a45bc7f19a56bd7959a496f617b501d1eae7513.tar.gz scala-1a45bc7f19a56bd7959a496f617b501d1eae7513.tar.bz2 scala-1a45bc7f19a56bd7959a496f617b501d1eae7513.zip |
A selection of collections additions from the l...
A selection of collections additions from the lower end of the
controversy scale.
// TraversableOnce
def collectFirst[B](pf: PartialFunction[A, B]): Option[B]
def maxBy[B](f: A => B)(implicit cmp: Ordering[B]): A
def minBy[B](f: A => B)(implicit cmp: Ordering[B]): A
// Iterator
def span(p: A => Boolean): (Iterator[A], Iterator[A])
// Traversable
def inits: Iterator[Repr]
def tails: Iterator[Repr]
def unzip3[A1, A2, A3](implicit asTriple: A => (A1, A2, A3)): (CC[A1], CC[A2], CC[A3])
// Sequences
def permutations: Iterator[Repr]
Review by odersky.
Diffstat (limited to 'src/library/scala/collection/LinearSeqOptimized.scala')
-rwxr-xr-x | src/library/scala/collection/LinearSeqOptimized.scala | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/library/scala/collection/LinearSeqOptimized.scala b/src/library/scala/collection/LinearSeqOptimized.scala index abe8e2fa62..c3dd161a65 100755 --- a/src/library/scala/collection/LinearSeqOptimized.scala +++ b/src/library/scala/collection/LinearSeqOptimized.scala @@ -104,17 +104,7 @@ trait LinearSeqOptimized[+A, +Repr <: LinearSeqOptimized[A, Repr]] extends Linea } None } -/* - override def mapFind[B](f: A => Option[B]): Option[B] = { - var res: Option[B] = None - var these = this - while (res.isEmpty && !these.isEmpty) { - res = f(these.head) - these = these.tail - } - res - } -*/ + override /*TraversableLike*/ def foldLeft[B](z: B)(f: (B, A) => B): B = { var acc = z |