Skip to content

Commit f3b42ad

Browse files
committed
Use switch-case instead of or-ed comparisons
1 parent 7a97754 commit f3b42ad

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,10 +548,15 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
548548
}
549549

550550
bool isBRA(const MCInst &Inst) const {
551-
return (Inst.getOpcode() == AArch64::BRAA ||
552-
Inst.getOpcode() == AArch64::BRAB ||
553-
Inst.getOpcode() == AArch64::BRAAZ ||
554-
Inst.getOpcode() == AArch64::BRABZ);
551+
switch (Inst.getOpcode()) {
552+
case AArch64::BRAA:
553+
case AArch64::BRAB:
554+
case AArch64::BRAAZ:
555+
case AArch64::BRABZ:
556+
return true;
557+
default:
558+
return false;
559+
}
555560
}
556561

557562
bool mayLoad(const MCInst &Inst) const override {

0 commit comments

Comments
 (0)