Skip to content

Commit

Permalink
Tiny simplification in funcletizer (#33284)
Browse files Browse the repository at this point in the history
  • Loading branch information
roji authored Mar 11, 2024
1 parent 0c0253b commit c8bcb0e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/EFCore/Query/Internal/ExpressionTreeFuncletizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,18 +421,7 @@ protected override Expression VisitConditional(ConditionalExpression conditional
goto case StateType.ContainsEvaluatable;

case StateType.ContainsEvaluatable:
if (testState.IsEvaluatable)
{
// Early optimization - if the test is evaluatable, simply reduce the conditional to the relevant clause
if (Evaluate(test) is bool testConstant)
{
_state = testConstant ? ifTrueState : ifFalseState;
return testConstant ? ifTrue : ifFalse;
}

test = ProcessEvaluatableRoot(test, ref testState);
}

// The case where the test is evaluatable has been handled above
if (ifTrueState.IsEvaluatable)
{
ifTrue = ProcessEvaluatableRoot(ifTrue, ref ifTrueState);
Expand Down

0 comments on commit c8bcb0e

Please sign in to comment.