Skip to content

Commit 1aff294

Browse files
authored
[BOLT][NFC] Simplify successor check (#91980)
Remove excess parentheses and use `boolean ? true-case : false-case` idiom.
1 parent 312f83f commit 1aff294

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bolt/lib/Core/BinaryBasicBlock.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,10 @@ bool BinaryBasicBlock::validateSuccessorInvariants() {
131131
break;
132132
}
133133
case 2:
134-
Valid = (CondBranch &&
135-
(TBB == getConditionalSuccessor(true)->getLabel() &&
136-
((!UncondBranch && !FBB) ||
137-
(UncondBranch &&
138-
FBB == getConditionalSuccessor(false)->getLabel()))));
134+
Valid =
135+
CondBranch && TBB == getConditionalSuccessor(true)->getLabel() &&
136+
(UncondBranch ? FBB == getConditionalSuccessor(false)->getLabel()
137+
: !FBB);
139138
break;
140139
}
141140
}

0 commit comments

Comments
 (0)