Skip to content

Commit 2b27330

Browse files
authored
Merge pull request #62676 from valeriyvan/CSSimplify-simplify-condition
[Refactoring] Simplify excessive conditional expression: (A && !B) || (!A && B) is equivalent to bool(A) != bool(B)
2 parents 182c1a4 + 194ecff commit 2b27330

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 (lhs->is<InOutType>() != 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)