@@ -399,7 +399,7 @@ self =>
399
399
that match {
400
400
case thatseq : ParSeq [S ] =>
401
401
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 {
403
403
_.resultWithTaskSupport
404
404
}
405
405
)
@@ -472,14 +472,14 @@ self =>
472
472
473
473
protected [this ] def down (p : IterableSplitter [_]) = p.asInstanceOf [SeqSplitter [T ]]
474
474
475
- protected trait Accessor [R , Tp ] extends super . Accessor [R , Tp ] {
475
+ protected trait ParSeqLikeAccessor [R , Tp ] extends Accessor [R , Tp ] {
476
476
protected [this ] val pit : SeqSplitter [T ]
477
477
}
478
478
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 ]
480
480
481
481
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 ] {
483
483
@ volatile var result : (Int , Boolean ) = null
484
484
def leaf (prev : Option [(Int , Boolean )]) = if (from < pit.indexFlag) {
485
485
val itsize = pit.remaining
@@ -497,7 +497,7 @@ self =>
497
497
}
498
498
499
499
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 ] {
501
501
@ volatile var result : Int = - 1
502
502
def leaf (prev : Option [Int ]) = if (from < pit.indexFlag) {
503
503
val r = pit.indexWhere(pred)
@@ -518,7 +518,7 @@ self =>
518
518
}
519
519
520
520
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 ] {
522
522
@ volatile var result : Int = - 1
523
523
def leaf (prev : Option [Int ]) = if (pos > pit.indexFlag) {
524
524
val r = pit.lastIndexWhere(pred)
@@ -539,23 +539,23 @@ self =>
539
539
}
540
540
541
541
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 ]] {
543
543
@ volatile var result : Combiner [U , This ] = null
544
544
def leaf (prev : Option [Combiner [U , This ]]) = result = pit.reverse2combiner(reuse(prev, cbf()))
545
545
protected [this ] def newSubtask (p : SuperParIterator ) = new Reverse (cbf, down(p))
546
546
override def merge (that : Reverse [U , This ]) = result = that.result combine result
547
547
}
548
548
549
549
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 ]] {
551
551
@ volatile var result : Combiner [S , That ] = null
552
552
def leaf (prev : Option [Combiner [S , That ]]) = result = pit.reverseMap2combiner(f, pbf())
553
553
protected [this ] def newSubtask (p : SuperParIterator ) = new ReverseMap (f, pbf, down(p))
554
554
override def merge (that : ReverseMap [S , That ]) = result = that.result combine result
555
555
}
556
556
557
557
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 ]] {
559
559
@ volatile var result : Boolean = true
560
560
def leaf (prev : Option [Boolean ]) = if (! pit.isAborted) {
561
561
result = pit.sameElements(otherpit)
@@ -572,7 +572,7 @@ self =>
572
572
}
573
573
574
574
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 ]] {
576
576
@ volatile var result : Combiner [U , That ] = null
577
577
def leaf (prev : Option [Combiner [U , That ]]) = result = pit.updated2combiner(pos, elem, pbf())
578
578
protected [this ] def newSubtask (p : SuperParIterator ) = throw new UnsupportedOperationException
@@ -584,8 +584,8 @@ self =>
584
584
override def requiresStrictSplitters = true
585
585
}
586
586
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 ]] {
589
589
@ volatile var result : Result = null
590
590
def leaf (prev : Option [Result ]) = result = pit.zip2combiner[U , S , That ](otherpit, cf())
591
591
protected [this ] def newSubtask (p : SuperParIterator ) = throw new UnsupportedOperationException
@@ -595,15 +595,15 @@ self =>
595
595
val pits = pit.psplitWithSignalling(fp, sp)
596
596
val opits = otherpit.psplitWithSignalling(fp, sp)
597
597
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 ))
600
600
)
601
601
}
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
603
603
}
604
604
605
605
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 ]] {
607
607
@ volatile var result : Boolean = true
608
608
def leaf (prev : Option [Boolean ]) = if (! pit.isAborted) {
609
609
result = pit.corresponds(corr)(otherpit)
0 commit comments