File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
src/library/scala/collection/immutable
test/junit/scala/collection/immutable Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ override def companion: GenericCompanion[Vector] = Vector
215
215
import Vector .{Log2ConcatFaster , TinyAppendFaster }
216
216
if (that.isEmpty) this .asInstanceOf [That ]
217
217
else {
218
- val again = if (! that.isTraversableAgain) that.toVector else that
218
+ val again = if (! that.isTraversableAgain) that.toVector else that.seq
219
219
again.size match {
220
220
// Often it's better to append small numbers of elements (or prepend if RHS is a vector)
221
221
case n if n <= TinyAppendFaster || n < (this .size >> Log2ConcatFaster ) =>
Original file line number Diff line number Diff line change
1
+ package scala .collection .immutable
2
+
3
+ import org .junit .{Assert , Test }
4
+ import org .junit .runner .RunWith
5
+ import org .junit .runners .JUnit4
6
+
7
+ @ RunWith (classOf [JUnit4 ])
8
+ class VectorTest {
9
+ /**
10
+ * Test Vector ++ with a small parallel collection concatenation (SI-9072).
11
+ *
12
+ */
13
+ @ Test
14
+ def testPlusPlus (): Unit = {
15
+ val smallVec = (0 to 1 )
16
+ val smallParVec = smallVec.par
17
+ val testElementsSize = (0 to 1000 ).map( _ => Vector .empty ++ smallParVec )
18
+ Assert .assertTrue(testElementsSize.forall( v => v.size == 2 ))
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments