|
|
@ -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
|
|
|
|
|
|
|
|
|
|
|
|