Avoid assignment used as condition

GitOrigin-RevId: 6eb52135a5bfdf772bb10d3120648500a95325a4
master
Tagir Valeev 4 years ago committed by intellij-monorepo-bot
parent ede143d4bd
commit e16fb8ef1d
  1. 20
      src/org/jetbrains/java/decompiler/modules/decompiler/IfHelper.java

@ -31,7 +31,8 @@ public final class IfHelper {
res |= mergeAllIfsRec(st, setReorderedIfs);
// collapse composed if's
if (changed = mergeIfs(st, setReorderedIfs)) {
if (mergeIfs(st, setReorderedIfs)) {
changed = true;
break;
}
}
@ -75,21 +76,25 @@ public final class IfHelper {
continue;
}
if (updated = collapseIfIf(rtnode)) {
if (collapseIfIf(rtnode)) {
updated = true;
break;
}
if (!setReorderedIfs.contains(stat.id)) {
if (updated = collapseIfElse(rtnode)) {
if (collapseIfElse(rtnode)) {
updated = true;
break;
}
if (updated = collapseElse(rtnode)) {
if (collapseElse(rtnode)) {
updated = true;
break;
}
}
if (updated = reorderIf((IfStatement)stat)) {
if (reorderIf((IfStatement)stat)) {
updated = true;
setReorderedIfs.add(stat.id);
break;
}
@ -440,13 +445,12 @@ public final class IfHelper {
if (sttemp == ifstat) {
break;
}
else {
if (elsedirectpath = existsPath(sttemp, next)) {
else if (existsPath(sttemp, next)) {
elsedirectpath = true;
break;
}
}
}
}
if ((ifdirect || ifdirectpath) && (elsedirect || elsedirectpath) && !noifstat && !noelsestat) { // if - then - else

Loading…
Cancel
Save