Skip to content

Commit 9333501

Browse files
committed
small rearrange
1 parent 0990b59 commit 9333501

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/FastExpressionCompiler/FastExpressionCompiler.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4913,21 +4913,17 @@ private static bool TryEmitSwitchEqual(
49134913
rightOpType = Nullable.GetUnderlyingType(rightOpType);
49144914
}
49154915

4916-
if (!leftOpType.IsPrimitive && !leftOpType.IsEnum)
4916+
if (leftOpType.IsPrimitive || leftOpType.IsEnum)
4917+
il.Demit(OpCodes.Ceq);
4918+
else
49174919
{
49184920
var method = FindComparisonMethod(il, "op_Equality", leftOpType, rightOpType) ?? _objectEqualsMethod;
4919-
Debug.Assert(method != null, "imporssible, we should at least have the _objectEqualsMethod");
4921+
Debug.Assert(method != null, "impossible, we should at least have the _objectEqualsMethod");
49204922
if (!EmitMethodCall(il, method))
49214923
return false;
4922-
if (leftIsNullable)
4923-
CompareNullableHasValueResults(il, left.Type, lVarIndex, rVarIndex);
4924-
}
4925-
else
4926-
{
4927-
il.Demit(OpCodes.Ceq);
4928-
if (leftIsNullable)
4929-
CompareNullableHasValueResults(il, left.Type, lVarIndex, rVarIndex);
49304924
}
4925+
if (leftIsNullable)
4926+
CompareNullableHasValueResults(il, left.Type, lVarIndex, rVarIndex);
49314927
}
49324928
}
49334929
return true;

0 commit comments

Comments
 (0)