Skip to content

Commit 9542f66

Browse files
committed
Streamline findMember
1 parent c9d5b2f commit 9542f66

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -632,16 +632,14 @@ object Types {
632632
go(l) & (go(r), pre, safeIntersection = ctx.pendingMemberSearches.contains(name))
633633
}
634634

635-
{ val recCount = ctx.findMemberCount + 1
636-
ctx.findMemberCount = recCount
637-
if (recCount >= Config.LogPendingFindMemberThreshold) {
638-
ctx.pendingMemberSearches = name :: ctx.pendingMemberSearches
639-
if (ctx.property(TypeOps.findMemberLimit).isDefined &&
640-
ctx.findMemberCount > Config.PendingFindMemberLimit)
641-
return NoDenotation
642-
}
635+
val recCount = ctx.findMemberCount
636+
if (recCount >= Config.LogPendingFindMemberThreshold) {
637+
if (ctx.property(TypeOps.findMemberLimit).isDefined &&
638+
ctx.findMemberCount > Config.PendingFindMemberLimit)
639+
return NoDenotation
640+
ctx.pendingMemberSearches = name :: ctx.pendingMemberSearches
643641
}
644-
642+
ctx.findMemberCount = recCount + 1
645643
//assert(ctx.findMemberCount < 20)
646644
try go(this)
647645
catch {
@@ -650,10 +648,9 @@ object Types {
650648
throw ex // DEBUG
651649
}
652650
finally {
653-
val recCount = ctx.findMemberCount
654651
if (recCount >= Config.LogPendingFindMemberThreshold)
655652
ctx.pendingMemberSearches = ctx.pendingMemberSearches.tail
656-
ctx.findMemberCount = recCount - 1
653+
ctx.findMemberCount = recCount
657654
}
658655
}
659656

0 commit comments

Comments
 (0)