diff options
author | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-04-02 13:11:23 +0000 |
---|---|---|
committer | Tiark Rompf <tiark.rompf@epfl.ch> | 2010-04-02 13:11:23 +0000 |
commit | cd51ac694d82c68a5c02f9f20a9460adbac780b4 (patch) | |
tree | 32fafdcc00c75f53d98bd4cc84eab13a6585e255 /src/library/scala/collection/immutable/Vector.scala | |
parent | 7b43c30aa1746cb37ee65f2871e4e92e82896a10 (diff) | |
download | scala-cd51ac694d82c68a5c02f9f20a9460adbac780b4.tar.gz scala-cd51ac694d82c68a5c02f9f20a9460adbac780b4.tar.bz2 scala-cd51ac694d82c68a5c02f9f20a9460adbac780b4.zip |
closes #3242. review by community.
Diffstat (limited to 'src/library/scala/collection/immutable/Vector.scala')
-rw-r--r-- | src/library/scala/collection/immutable/Vector.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/scala/collection/immutable/Vector.scala b/src/library/scala/collection/immutable/Vector.scala index 3377943244..0da702f508 100644 --- a/src/library/scala/collection/immutable/Vector.scala +++ b/src/library/scala/collection/immutable/Vector.scala @@ -668,11 +668,12 @@ final class VectorBuilder[A]() extends Builder[A,Vector[A]] with VectorPointer[A } def result: Vector[A] = { - if (blockIndex + lo == 0) + val size = blockIndex + lo + if (size == 0) return Vector.empty - val s = new Vector[A](0, blockIndex + lo, 0) // should focus front or back? + val s = new Vector[A](0, size, 0) // should focus front or back? s.initFrom(this) - if (depth > 1) s.gotoPos(0, blockIndex + lo) + if (depth > 1) s.gotoPos(0, size - 1) // we're currently focused to size - 1, not size! s } |