diff options
Diffstat (limited to 'src/library/scala/collection/IndexedSeqOptimized.scala')
-rwxr-xr-x | src/library/scala/collection/IndexedSeqOptimized.scala | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/library/scala/collection/IndexedSeqOptimized.scala b/src/library/scala/collection/IndexedSeqOptimized.scala index 0d95108235..e680d02183 100755 --- a/src/library/scala/collection/IndexedSeqOptimized.scala +++ b/src/library/scala/collection/IndexedSeqOptimized.scala @@ -102,17 +102,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends IndexedSeqLike[A, Repr] { self => } override /*IterableLike*/ - def slice(from: Int, until: Int): Repr = { - var i = from max 0 - val end = until min length - val b = newBuilder - b.sizeHint(end - i) - while (i < end) { - b += this(i) - i += 1 - } - b.result - } + def slice(from: Int, until: Int): Repr = sliceWithKnownSize(from max 0, until min length) override /*IterableLike*/ def head: A = if (isEmpty) super.head else this(0) |