@@ -24,9 +24,8 @@ import scala.collection.mutable.GrowableBuilder
24
24
import scala .util .Try
25
25
import scala .util .hashing .Hashing
26
26
import language .experimental .captureChecking
27
- import caps .unsafe .unsafeAssumePure
28
27
29
- private [collection] final class INode [sealed K , sealed V ](bn : MainNode [K , V ], g : Gen , equiv : Equiv [K ]) extends INodeBase [K , V ](g) {
28
+ private [collection] final class INode [K , V ](bn : MainNode [K , V ], g : Gen , equiv : Equiv [K ]) extends INodeBase [K , V ](g) {
30
29
import INodeBase ._
31
30
32
31
WRITE (bn)
@@ -429,15 +428,15 @@ private[concurrent] object INode {
429
428
final val KEY_ABSENT = new AnyRef
430
429
final val KEY_PRESENT_OR_ABSENT = new AnyRef
431
430
432
- def newRootNode [sealed K , sealed V ](equiv : Equiv [K ]) = {
431
+ def newRootNode [K , V ](equiv : Equiv [K ]) = {
433
432
val gen = new Gen
434
433
val cn = new CNode [K , V ](0 , new Array (0 ), gen)
435
434
new INode [K , V ](cn, gen, equiv)
436
435
}
437
436
}
438
437
439
438
440
- private [concurrent] final class FailedNode [sealed K , sealed V ](p : MainNode [K , V ]) extends MainNode [K , V ] {
439
+ private [concurrent] final class FailedNode [K , V ](p : MainNode [K , V ]) extends MainNode [K , V ] {
441
440
WRITE_PREV (p)
442
441
443
442
def string (lev : Int ) = throw new UnsupportedOperationException
@@ -450,12 +449,12 @@ private[concurrent] final class FailedNode[sealed K, sealed V](p: MainNode[K, V]
450
449
}
451
450
452
451
453
- private [concurrent] trait KVNode [sealed K , sealed V ] {
452
+ private [concurrent] trait KVNode [K , V ] {
454
453
def kvPair : (K , V )
455
454
}
456
455
457
456
458
- private [collection] final class SNode [sealed K , sealed V ](final val k : K , final val v : V , final val hc : Int )
457
+ private [collection] final class SNode [K , V ](final val k : K , final val v : V , final val hc : Int )
459
458
extends BasicNode with KVNode [K , V ] {
460
459
def copy = new SNode (k, v, hc)
461
460
def copyTombed = new TNode (k, v, hc)
@@ -465,7 +464,7 @@ private[collection] final class SNode[sealed K, sealed V](final val k: K, final
465
464
}
466
465
467
466
// Tomb Node, used to ensure proper ordering during removals
468
- private [collection] final class TNode [sealed K , sealed V ](final val k : K , final val v : V , final val hc : Int )
467
+ private [collection] final class TNode [K , V ](final val k : K , final val v : V , final val hc : Int )
469
468
extends MainNode [K , V ] with KVNode [K , V ] {
470
469
def copy = new TNode (k, v, hc)
471
470
def copyTombed = new TNode (k, v, hc)
@@ -477,7 +476,7 @@ private[collection] final class TNode[sealed K, sealed V](final val k: K, final
477
476
}
478
477
479
478
// List Node, leaf node that handles hash collisions
480
- private [collection] final class LNode [sealed K , sealed V ](val entries : List [(K , V )], equiv : Equiv [K ])
479
+ private [collection] final class LNode [K , V ](val entries : List [(K , V )], equiv : Equiv [K ])
481
480
extends MainNode [K , V ] {
482
481
483
482
def this (k : K , v : V , equiv : Equiv [K ]) = this ((k -> v) :: Nil , equiv)
@@ -519,7 +518,7 @@ private[collection] final class LNode[sealed K, sealed V](val entries: List[(K,
519
518
}
520
519
521
520
// Ctrie Node, contains bitmap and array of references to branch nodes
522
- private [collection] final class CNode [sealed K , sealed V ](val bitmap : Int , val array : Array [BasicNode ], val gen : Gen ) extends CNodeBase [K , V ] {
521
+ private [collection] final class CNode [K , V ](val bitmap : Int , val array : Array [BasicNode ], val gen : Gen ) extends CNodeBase [K , V ] {
523
522
// this should only be called from within read-only snapshots
524
523
def cachedSize (ct : AnyRef ): Int = {
525
524
val currsz = READ_SIZE ()
@@ -655,7 +654,7 @@ private[collection] final class CNode[sealed K, sealed V](val bitmap: Int, val a
655
654
656
655
private [concurrent] object CNode {
657
656
658
- def dual [sealed K , sealed V ](x : SNode [K , V ], xhc : Int , y : SNode [K , V ], yhc : Int , lev : Int , gen : Gen , equiv : Equiv [K ]): MainNode [K , V ] = if (lev < 35 ) {
657
+ def dual [K , V ](x : SNode [K , V ], xhc : Int , y : SNode [K , V ], yhc : Int , lev : Int , gen : Gen , equiv : Equiv [K ]): MainNode [K , V ] = if (lev < 35 ) {
659
658
val xidx = (xhc >>> lev) & 0x1f
660
659
val yidx = (yhc >>> lev) & 0x1f
661
660
val bmp = (1 << xidx) | (1 << yidx)
@@ -690,7 +689,7 @@ private[concurrent] case class RDCSS_Descriptor[K, V](old: INode[K, V], expected
690
689
* For details, see: [[http://lampwww.epfl.ch/~prokopec/ctries-snapshot.pdf ]]
691
690
*/
692
691
@ SerialVersionUID (- 5212455458703321708L )
693
- final class TrieMap [sealed K , sealed V ] private (r : AnyRef , rtupd : AtomicReferenceFieldUpdater [TrieMap [K , V ], AnyRef ], hashf : Hashing [K ], ef : Equiv [K ])
692
+ final class TrieMap [K , V ] private (r : AnyRef , rtupd : AtomicReferenceFieldUpdater [TrieMap [K , V ], AnyRef ], hashf : Hashing [K ], ef : Equiv [K ])
694
693
extends scala.collection.mutable.AbstractMap [K , V ]
695
694
with scala.collection.concurrent.Map [K , V ]
696
695
with scala.collection.mutable.MapOps [K , V , TrieMap , TrieMap [K , V ]]
@@ -1043,11 +1042,11 @@ final class TrieMap[sealed K, sealed V] private (r: AnyRef, rtupd: AtomicReferen
1043
1042
@ SerialVersionUID (3L )
1044
1043
object TrieMap extends MapFactory [TrieMap ] {
1045
1044
1046
- def empty [sealed K , sealed V ]: TrieMap [K , V ] = new TrieMap [K , V ]
1045
+ def empty [K , V ]: TrieMap [K , V ] = new TrieMap [K , V ]
1047
1046
1048
- def from [sealed K , sealed V ](it : IterableOnce [(K , V )]^ ): TrieMap [K , V ] = new TrieMap [K , V ]() ++= it
1047
+ def from [K , V ](it : IterableOnce [(K , V )]^ ): TrieMap [K , V ] = new TrieMap [K , V ]() ++= it
1049
1048
1050
- def newBuilder [sealed K , sealed V ]: mutable.GrowableBuilder [(K , V ), TrieMap [K , V ]] = new GrowableBuilder (empty[K , V ])
1049
+ def newBuilder [K , V ]: mutable.GrowableBuilder [(K , V ), TrieMap [K , V ]] = new GrowableBuilder (empty[K , V ])
1051
1050
1052
1051
@ transient
1053
1052
val inodeupdater : AtomicReferenceFieldUpdater [INodeBase [_, _], MainNode [_, _]] = AtomicReferenceFieldUpdater .newUpdater(classOf [INodeBase [_, _]], classOf [MainNode [_, _]], " mainnode" )
@@ -1071,7 +1070,7 @@ object TrieMap extends MapFactory[TrieMap] {
1071
1070
}
1072
1071
1073
1072
// non-final as an extension point for parallel collections
1074
- private [collection] class TrieMapIterator [sealed K , sealed V ](var level : Int , private var ct : TrieMap [K , V ], mustInit : Boolean = true ) extends AbstractIterator [(K , V )] {
1073
+ private [collection] class TrieMapIterator [K , V ](var level : Int , private var ct : TrieMap [K , V ], mustInit : Boolean = true ) extends AbstractIterator [(K , V )] {
1075
1074
private val stack = new Array [Array [BasicNode ]](7 )
1076
1075
private val stackpos = new Array [Int ](7 )
1077
1076
private var depth = - 1
0 commit comments