summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/immutable/List.scala
diff options
context:
space:
mode:
authorRex Kerr <ichoran@gmail.com>2015-02-18 18:52:46 -0800
committerRex Kerr <ichoran@gmail.com>2015-02-20 00:07:44 -0800
commit1d4a1f721d360c73b9f2468368c7e9b2b4c17fea (patch)
tree9cd0a2db1374c03934adde0483f43dd96cac235a /src/library/scala/collection/immutable/List.scala
parent18870094f2464e39067baeea71c4ae7ab8dfc6d9 (diff)
downloadscala-1d4a1f721d360c73b9f2468368c7e9b2b4c17fea.tar.gz
scala-1d4a1f721d360c73b9f2468368c7e9b2b4c17fea.tar.bz2
scala-1d4a1f721d360c73b9f2468368c7e9b2b4c17fea.zip
SI-9126 Missing .seqs causes problems with parallel GenXs
Added `.seq` in two essential places so that a parallel collection passed as an argument won't mess up side-effecting sequential computations in `List.flatMap` and `GenericTraversableTemplate.transpose` (thanks to retronym for finding the danger spots). Tests that `.seq` is called by constructing a `GenSeq` whose `.seq` disagrees with anything non-`.seq` (idea & working implementation from retronym). Also updates the `.seq` test for `Vector#++` to use the new more efficient method.
Diffstat (limited to 'src/library/scala/collection/immutable/List.scala')
-rw-r--r--src/library/scala/collection/immutable/List.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index a46b4adabb..254f14f13c 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -324,7 +324,7 @@ sealed abstract class List[+A] extends AbstractSeq[A]
var h: ::[B] = null
var t: ::[B] = null
while (rest ne Nil) {
- f(rest.head).foreach{ b =>
+ f(rest.head).seq.foreach{ b =>
if (!found) {
h = new ::(b, Nil)
t = h