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

Loading…
Cancel
Save