Skip to content

Commit b515836

Browse files
committed
Simplify conditional expression: (A && !B) || (!A && B) is equivalent to bool(A) != bool(B)
1 parent 54f9cae commit b515836

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5645,8 +5645,7 @@ bool ConstraintSystem::repairFailures(
56455645

56465646
auto *parentLoc = getConstraintLocator(anchor, path);
56475647

5648-
if ((lhs->is<InOutType>() && !rhs->is<InOutType>()) ||
5649-
(!lhs->is<InOutType>() && rhs->is<InOutType>())) {
5648+
if (bool(lhs->is<InOutType>()) != bool(rhs->is<InOutType>())) {
56505649
// Since `FunctionArgument` as a last locator element represents
56515650
// a single parameter of the function type involved in a conversion
56525651
// to another function type, see `matchFunctionTypes`. If there is already

0 commit comments

Comments
 (0)