File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -5577,11 +5577,11 @@ object Types {
55775577 }
55785578
55795579 class TypeSizeAccumulator (using Context ) extends TypeAccumulator [Int ] {
5580- val seen = new java. util.IdentityHashMap [Type , Type ]
5580+ var seen = util.HashSet [Type ](initialCapacity = 8 )
55815581 def apply (n : Int , tp : Type ): Int =
5582- if ( seen.get (tp) != null ) n
5582+ if seen.contains (tp) then n
55835583 else {
5584- seen.put(tp, tp)
5584+ seen += tp
55855585 tp match {
55865586 case tp : AppliedType =>
55875587 foldOver(n + 1 , tp)
@@ -5598,11 +5598,11 @@ object Types {
55985598 }
55995599
56005600 class CoveringSetAccumulator (using Context ) extends TypeAccumulator [Set [Symbol ]] {
5601- val seen = new java. util.IdentityHashMap [Type , Type ]
5601+ var seen = util.HashSet [Type ](initialCapacity = 8 )
56025602 def apply (cs : Set [Symbol ], tp : Type ): Set [Symbol ] =
5603- if ( seen.get (tp) != null ) cs
5603+ if seen.contains (tp) then cs
56045604 else {
5605- seen.put(tp, tp)
5605+ seen += tp
56065606 tp match {
56075607 case tp if tp.isTopType || tp.isBottomType =>
56085608 cs
Original file line number Diff line number Diff line change 11package dotty .tools .dotc .util
22import collection .immutable
33
4- /** A linear identity set is a set that uses `eq` as the underlying
5- * equality where after a `+` the previous set value cannot be used anymore.
6- * The set is implemented as an immutable set for
7- * sizes <= 4 and as a HashSet for larger sizes.
4+ /** A linear set is a set here after a `+` the previous set value cannot be
5+ * used anymore. The set is implemented as an immutable set for sizes <= 4
6+ * and as a HashSet for larger sizes.
87 */
98opaque type LinearSet [Elem >: Null <: AnyRef ] =
109 immutable.Set [Elem ] | HashSet [Elem ]
You can’t perform that action at this time.
0 commit comments