Skip to content

Commit cfa0d63

Browse files
authored
Merge pull request #62721 from valeriyvan/RequirementMachineRequests
[Gardening] Simplify excessive conditional expression: (A && !B) || (!A && B) is equivalent to bool(A) != bool(B)
2 parents 5d0fbaa + f3e7407 commit cfa0d63

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/AST/RequirementMachine/RequirementMachineRequests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,7 @@ InferredGenericSignatureRequest::evaluate(
954954
// If one side is a parameter pack and the other is not, this is a
955955
// same-element requirement that cannot be expressed with only one
956956
// type parameter.
957-
if ((genericParam->isParameterPack() && !reduced->isParameterPack()) ||
958-
(!genericParam->isParameterPack() && reduced->isParameterPack()))
957+
if (genericParam->isParameterPack() != reduced->isParameterPack())
959958
continue;
960959

961960
ctx.Diags.diagnose(loc, diag::requires_generic_params_made_equal,

0 commit comments

Comments
 (0)