File tree 2 files changed +8
-22
lines changed
compiler/src/dotty/tools/dotc
2 files changed +8
-22
lines changed Original file line number Diff line number Diff line change @@ -3491,28 +3491,26 @@ object Types {
3491
3491
*/
3492
3492
private def gatherTreeUniqueMembersAbsorbingNothingTypes (using Context ): MutableSet [Type ] = {
3493
3493
3494
- var trees = List (this )
3494
+ var unvisitedSubtrees = List (this )
3495
3495
val uniqueTreeMembers = new EqLinkedHashSet [Type ]
3496
3496
3497
- while (trees .nonEmpty) {
3498
- trees match {
3497
+ while (unvisitedSubtrees .nonEmpty) {
3498
+ unvisitedSubtrees match
3499
3499
case head :: tail =>
3500
- head match {
3500
+ head match
3501
3501
case OrType (l : OrType , r : OrType ) =>
3502
- trees = l :: r :: tail
3502
+ unvisitedSubtrees = l :: r :: tail
3503
3503
case OrType (l, r : OrType ) =>
3504
- trees = r :: tail
3504
+ unvisitedSubtrees = r :: tail
3505
3505
if ! l.isNothingType then uniqueTreeMembers += l
3506
3506
case OrType (l : OrType , r) =>
3507
- trees = l :: tail
3507
+ unvisitedSubtrees = l :: tail
3508
3508
if ! r.isNothingType then uniqueTreeMembers += r
3509
3509
case OrType (l, r) =>
3510
- trees = tail
3510
+ unvisitedSubtrees = tail
3511
3511
uniqueTreeMembers += l
3512
3512
if ! r.isNothingType then uniqueTreeMembers += r
3513
- }
3514
3513
case _ =>
3515
- }
3516
3514
}
3517
3515
3518
3516
uniqueTreeMembers
Original file line number Diff line number Diff line change @@ -32,15 +32,3 @@ class EqLinkedHashSet[T](
32
32
override def iterator : Iterator [T ] = linkingArray.iterator
33
33
34
34
}
35
-
36
- object EqLinkedHashSet {
37
- def apply [T ](x : T ): EqLinkedHashSet [T ] =
38
- val set = new EqLinkedHashSet [T ]
39
- set += x
40
- set
41
-
42
- def apply [T ](x : T , y : T ): EqLinkedHashSet [T ] =
43
- val set = EqLinkedHashSet (x)
44
- set += y
45
- set
46
- }
You can’t perform that action at this time.
0 commit comments