mirror of
https://github.com/moparisthebest/fernflower
synced 2024-10-31 23:45:08 -04:00
Cleanup (loop invariant optimization; formatting)
This commit is contained in:
parent
5349ad435b
commit
91c64c5a94
@ -426,20 +426,18 @@ public class LabelHelper {
|
|||||||
HashSet<Statement> setContinue = new HashSet<Statement>();
|
HashSet<Statement> setContinue = new HashSet<Statement>();
|
||||||
|
|
||||||
if (stat.getExprents() == null) {
|
if (stat.getExprents() == null) {
|
||||||
for(Statement st : stat.getStats()) {
|
for (Statement st : stat.getStats()) {
|
||||||
HashSet<Statement>[] arr = processStatementLabel(st);
|
HashSet<Statement>[] arr = processStatementLabel(st);
|
||||||
|
|
||||||
setBreak.addAll(arr[0]);
|
setBreak.addAll(arr[0]);
|
||||||
setContinue.addAll(arr[1]);
|
setContinue.addAll(arr[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean shieldtype = (stat.type == Statement.TYPE_DO || stat.type == Statement.TYPE_SWITCH);
|
boolean shieldType = (stat.type == Statement.TYPE_DO || stat.type == Statement.TYPE_SWITCH);
|
||||||
|
if (shieldType) {
|
||||||
for(StatEdge edge : stat.getLabelEdges()) {
|
for (StatEdge edge : stat.getLabelEdges()) {
|
||||||
if (edge.explicit) {
|
if (edge.explicit && ((edge.getType() == StatEdge.TYPE_BREAK && setBreak.contains(edge.getSource())) ||
|
||||||
if (shieldtype
|
(edge.getType() == StatEdge.TYPE_CONTINUE && setContinue.contains(edge.getSource())))) {
|
||||||
&& ((edge.getType() == StatEdge.TYPE_BREAK && setBreak.contains(edge.getSource())) || (edge.getType() == StatEdge.TYPE_CONTINUE && setContinue.contains(edge
|
|
||||||
.getSource())))) {
|
|
||||||
edge.labeled = false;
|
edge.labeled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user