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 @@ -3475,28 +3475,26 @@ object Types {
3475
3475
*/
3476
3476
private def gatherTreeUniqueMembersAbsorbingNothingTypes (using Context ): MutableSet [Type ] = {
3477
3477
3478
- var trees = List (this )
3478
+ var unvisitedSubtrees = List (this )
3479
3479
val uniqueTreeMembers = new EqLinkedHashSet [Type ]
3480
3480
3481
- while (trees .nonEmpty) {
3482
- trees match {
3481
+ while (unvisitedSubtrees .nonEmpty) {
3482
+ unvisitedSubtrees match
3483
3483
case head :: tail =>
3484
- head match {
3484
+ head match
3485
3485
case OrType (l : OrType , r : OrType ) =>
3486
- trees = l :: r :: tail
3486
+ unvisitedSubtrees = l :: r :: tail
3487
3487
case OrType (l, r : OrType ) =>
3488
- trees = r :: tail
3488
+ unvisitedSubtrees = r :: tail
3489
3489
if ! l.isNothingType then uniqueTreeMembers += l
3490
3490
case OrType (l : OrType , r) =>
3491
- trees = l :: tail
3491
+ unvisitedSubtrees = l :: tail
3492
3492
if ! r.isNothingType then uniqueTreeMembers += r
3493
3493
case OrType (l, r) =>
3494
- trees = tail
3494
+ unvisitedSubtrees = tail
3495
3495
uniqueTreeMembers += l
3496
3496
if ! r.isNothingType then uniqueTreeMembers += r
3497
- }
3498
3497
case _ =>
3499
- }
3500
3498
}
3501
3499
3502
3500
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