Skip to content

Commit

Permalink
Remove debug-only assert method (#74996)
Browse files Browse the repository at this point in the history
This method is only used in one place, only wraps one method call, and can cause people to accidentally select the wrong method in RELEASE mode. I've just inlined the content and removed the method.
  • Loading branch information
333fred authored Sep 5, 2024
1 parent 2ff1a47 commit 8ce8103
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3126,17 +3126,6 @@ public override BoundNode VisitReturnStatement(BoundReturnStatement node)

private const int BetterConversionTargetRecursionLimit = 100;

#if DEBUG
private BetterResult BetterConversionTarget(
TypeSymbol type1,
TypeSymbol type2,
ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
{
bool okToDowngradeToNeither;
return BetterConversionTargetCore(null, type1, default(Conversion), type2, default(Conversion), ref useSiteInfo, out okToDowngradeToNeither, BetterConversionTargetRecursionLimit);
}
#endif

private BetterResult BetterConversionTargetCore(
TypeSymbol type1,
TypeSymbol type2,
Expand Down Expand Up @@ -3415,7 +3404,7 @@ private bool CanDowngradeConversionFromLambdaToNeither(BetterResult currentResul
Debug.Assert(
r1.IsErrorType() ||
r2.IsErrorType() ||
currentResult == BetterConversionTarget(r1, r2, ref useSiteInfo));
currentResult == BetterConversionTargetCore(null, type1, default(Conversion), type2, default(Conversion), ref useSiteInfo, out _, BetterConversionTargetRecursionLimit));
}
#endif
}
Expand Down

0 comments on commit 8ce8103

Please sign in to comment.