@@ -399,7 +399,7 @@ self =>
399399 that match {
400400 case thatseq : ParSeq [S ] =>
401401 tasksupport.executeAndWaitResult(
402- new Zip (length min thatseq.length, combinerFactory(() => companion.newCombiner[(U , S )]), splitter, thatseq.splitter) mapResult {
402+ new ParSeqLikeZip (length min thatseq.length, combinerFactory(() => companion.newCombiner[(U , S )]), splitter, thatseq.splitter) mapResult {
403403 _.resultWithTaskSupport
404404 }
405405 )
@@ -472,14 +472,14 @@ self =>
472472
473473 protected [this ] def down (p : IterableSplitter [_]) = p.asInstanceOf [SeqSplitter [T ]]
474474
475- protected trait Accessor [R , Tp ] extends super . Accessor [R , Tp ] {
475+ protected trait ParSeqLikeAccessor [R , Tp ] extends Accessor [R , Tp ] {
476476 protected [this ] val pit : SeqSplitter [T ]
477477 }
478478
479- protected trait Transformer [R , Tp ] extends Accessor [R , Tp ] with super . Transformer [R , Tp ]
479+ protected trait ParSeqLikeTransformer [R , Tp ] extends ParSeqLikeAccessor [R , Tp ] with Transformer [R , Tp ]
480480
481481 protected [this ] class SegmentLength (pred : T => Boolean , from : Int , protected [this ] val pit : SeqSplitter [T ])
482- extends Accessor [(Int , Boolean ), SegmentLength ] {
482+ extends ParSeqLikeAccessor [(Int , Boolean ), SegmentLength ] {
483483 @ volatile var result : (Int , Boolean ) = null
484484 def leaf (prev : Option [(Int , Boolean )]) = if (from < pit.indexFlag) {
485485 val itsize = pit.remaining
@@ -497,7 +497,7 @@ self =>
497497 }
498498
499499 protected [this ] class IndexWhere (pred : T => Boolean , from : Int , protected [this ] val pit : SeqSplitter [T ])
500- extends Accessor [Int , IndexWhere ] {
500+ extends ParSeqLikeAccessor [Int , IndexWhere ] {
501501 @ volatile var result : Int = - 1
502502 def leaf (prev : Option [Int ]) = if (from < pit.indexFlag) {
503503 val r = pit.indexWhere(pred)
@@ -518,7 +518,7 @@ self =>
518518 }
519519
520520 protected [this ] class LastIndexWhere (pred : T => Boolean , pos : Int , protected [this ] val pit : SeqSplitter [T ])
521- extends Accessor [Int , LastIndexWhere ] {
521+ extends ParSeqLikeAccessor [Int , LastIndexWhere ] {
522522 @ volatile var result : Int = - 1
523523 def leaf (prev : Option [Int ]) = if (pos > pit.indexFlag) {
524524 val r = pit.lastIndexWhere(pred)
@@ -539,23 +539,23 @@ self =>
539539 }
540540
541541 protected [this ] class Reverse [U >: T , This >: Repr ](cbf : () => Combiner [U , This ], protected [this ] val pit : SeqSplitter [T ])
542- extends Transformer [Combiner [U , This ], Reverse [U , This ]] {
542+ extends ParSeqLikeTransformer [Combiner [U , This ], Reverse [U , This ]] {
543543 @ volatile var result : Combiner [U , This ] = null
544544 def leaf (prev : Option [Combiner [U , This ]]) = result = pit.reverse2combiner(reuse(prev, cbf()))
545545 protected [this ] def newSubtask (p : SuperParIterator ) = new Reverse (cbf, down(p))
546546 override def merge (that : Reverse [U , This ]) = result = that.result combine result
547547 }
548548
549549 protected [this ] class ReverseMap [S , That ](f : T => S , pbf : () => Combiner [S , That ], protected [this ] val pit : SeqSplitter [T ])
550- extends Transformer [Combiner [S , That ], ReverseMap [S , That ]] {
550+ extends ParSeqLikeTransformer [Combiner [S , That ], ReverseMap [S , That ]] {
551551 @ volatile var result : Combiner [S , That ] = null
552552 def leaf (prev : Option [Combiner [S , That ]]) = result = pit.reverseMap2combiner(f, pbf())
553553 protected [this ] def newSubtask (p : SuperParIterator ) = new ReverseMap (f, pbf, down(p))
554554 override def merge (that : ReverseMap [S , That ]) = result = that.result combine result
555555 }
556556
557557 protected [this ] class SameElements [U >: T ](protected [this ] val pit : SeqSplitter [T ], val otherpit : SeqSplitter [U ])
558- extends Accessor [Boolean , SameElements [U ]] {
558+ extends ParSeqLikeAccessor [Boolean , SameElements [U ]] {
559559 @ volatile var result : Boolean = true
560560 def leaf (prev : Option [Boolean ]) = if (! pit.isAborted) {
561561 result = pit.sameElements(otherpit)
@@ -572,7 +572,7 @@ self =>
572572 }
573573
574574 protected [this ] class Updated [U >: T , That ](pos : Int , elem : U , pbf : CombinerFactory [U , That ], protected [this ] val pit : SeqSplitter [T ])
575- extends Transformer [Combiner [U , That ], Updated [U , That ]] {
575+ extends ParSeqLikeTransformer [Combiner [U , That ], Updated [U , That ]] {
576576 @ volatile var result : Combiner [U , That ] = null
577577 def leaf (prev : Option [Combiner [U , That ]]) = result = pit.updated2combiner(pos, elem, pbf())
578578 protected [this ] def newSubtask (p : SuperParIterator ) = throw new UnsupportedOperationException
@@ -584,8 +584,8 @@ self =>
584584 override def requiresStrictSplitters = true
585585 }
586586
587- protected [this ] class Zip [U >: T , S , That ](len : Int , cf : CombinerFactory [(U , S ), That ], protected [this ] val pit : SeqSplitter [T ], val otherpit : SeqSplitter [S ])
588- extends Transformer [Combiner [(U , S ), That ], Zip [U , S , That ]] {
587+ protected [this ] class ParSeqLikeZip [U >: T , S , That ](len : Int , cf : CombinerFactory [(U , S ), That ], protected [this ] val pit : SeqSplitter [T ], val otherpit : SeqSplitter [S ])
588+ extends ParSeqLikeTransformer [Combiner [(U , S ), That ], ParSeqLikeZip [U , S , That ]] {
589589 @ volatile var result : Result = null
590590 def leaf (prev : Option [Result ]) = result = pit.zip2combiner[U , S , That ](otherpit, cf())
591591 protected [this ] def newSubtask (p : SuperParIterator ) = throw new UnsupportedOperationException
@@ -595,15 +595,15 @@ self =>
595595 val pits = pit.psplitWithSignalling(fp, sp)
596596 val opits = otherpit.psplitWithSignalling(fp, sp)
597597 Seq (
598- new Zip (fp, cf, pits(0 ), opits(0 )),
599- new Zip (sp, cf, pits(1 ), opits(1 ))
598+ new ParSeqLikeZip (fp, cf, pits(0 ), opits(0 )),
599+ new ParSeqLikeZip (sp, cf, pits(1 ), opits(1 ))
600600 )
601601 }
602- override def merge (that : Zip [U , S , That ]) = result = result combine that.result
602+ override def merge (that : ParSeqLikeZip [U , S , That ]) = result = result combine that.result
603603 }
604604
605605 protected [this ] class Corresponds [S ](corr : (T , S ) => Boolean , protected [this ] val pit : SeqSplitter [T ], val otherpit : SeqSplitter [S ])
606- extends Accessor [Boolean , Corresponds [S ]] {
606+ extends ParSeqLikeAccessor [Boolean , Corresponds [S ]] {
607607 @ volatile var result : Boolean = true
608608 def leaf (prev : Option [Boolean ]) = if (! pit.isAborted) {
609609 result = pit.corresponds(corr)(otherpit)
0 commit comments