diff options
author | Martin Odersky <odersky@gmail.com> | 2010-05-11 09:35:30 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-05-11 09:35:30 +0000 |
commit | 180c6d047dbe16d5a2d4ec9186aad749e64e012d (patch) | |
tree | dbda4c7d960e8d713172c17b25818c50ba9a8393 /src | |
parent | 57a0b3d1657468c037751a2a6c833f6814ae78c0 (diff) | |
download | scala-180c6d047dbe16d5a2d4ec9186aad749e64e012d.tar.gz scala-180c6d047dbe16d5a2d4ec9186aad749e64e012d.tar.bz2 scala-180c6d047dbe16d5a2d4ec9186aad749e64e012d.zip |
Corrected sizeHints for scanLeft/Right
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/TraversableLike.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala index 02777a5daa..fd6c000827 100644 --- a/src/library/scala/collection/TraversableLike.scala +++ b/src/library/scala/collection/TraversableLike.scala @@ -430,7 +430,7 @@ trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr] with Traversable */ def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = { val b = bf(repr) - b.sizeHint(this) + b.sizeHint(this, 1) var acc = z b += acc for (x <- this) { acc = op(acc, x); b += acc } @@ -451,7 +451,7 @@ trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr] with Traversable */ def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = { val b = bf(repr) - b.sizeHint(this) + b.sizeHint(this, 1) var acc = z b += acc for (x <- reversed) { acc = op(x, acc); b += acc } |