Skip to content

Commit

Permalink
fix: improve negation condition checks for switch over string (#2333)
Browse files Browse the repository at this point in the history
  • Loading branch information
skylot committed Nov 1, 2024
1 parent 3991239 commit 313c4a1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ private boolean processCase(SwitchData switchData, SwitchRegion.CaseInfo caseInf
if (ifInsn.getOp() == IfOp.NE && ifInsn.getArg(1).isTrue()) {
neg = true;
}
if (ifInsn.getOp() == IfOp.EQ && ifInsn.getArg(1).isFalse()) {
neg = true;
}
if (str != null) {
switchData.getToRemove().add(ifInsn);
switchData.getToRemove().addAll(ifRegion.getConditionBlocks());
Expand Down

0 comments on commit 313c4a1

Please sign in to comment.