File tree Expand file tree Collapse file tree 1 file changed +17
-12
lines changed
library/src/scala/collection/immutable Expand file tree Collapse file tree 1 file changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -204,18 +204,23 @@ final class Vector[+A] private[immutable] (private[collection] val startIndex: I
204
204
import Vector .{Log2ConcatFaster , TinyAppendFaster }
205
205
if (prefix.iterator.isEmpty) this
206
206
else {
207
- prefix.size match {
208
- case n if n <= TinyAppendFaster || n < (this .size >>> Log2ConcatFaster ) =>
209
- var v : Vector [B ] = this
210
- val it = prefix.toIndexedSeq.reverseIterator
211
- while (it.hasNext) v = it.next() +: v
212
- v
213
- case n if this .size < (n >>> Log2ConcatFaster ) && prefix.isInstanceOf [Vector [_]] =>
214
- var v = prefix.asInstanceOf [Vector [B ]]
215
- val it = this .iterator
216
- while (it.hasNext) v = v :+ it.next()
217
- v
218
- case _ => super .prependedAll(prefix)
207
+ prefix match {
208
+ case prefix : collection.Iterable [B ] =>
209
+ prefix.size match {
210
+ case n if n <= TinyAppendFaster || n < (this .size >>> Log2ConcatFaster ) =>
211
+ var v : Vector [B ] = this
212
+ val it = prefix.toIndexedSeq.reverseIterator
213
+ while (it.hasNext) v = it.next() +: v
214
+ v
215
+ case n if this .size < (n >>> Log2ConcatFaster ) && prefix.isInstanceOf [Vector [_]] =>
216
+ var v = prefix.asInstanceOf [Vector [B ]]
217
+ val it = this .iterator
218
+ while (it.hasNext) v = v :+ it.next()
219
+ v
220
+ case _ => super .prependedAll(prefix)
221
+ }
222
+ case _ =>
223
+ super .prependedAll(prefix)
219
224
}
220
225
}
221
226
}
You can’t perform that action at this time.
0 commit comments