diff options
author | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-09-29 16:04:25 +0200 |
---|---|---|
committer | Roman Shevchenko <roman.shevchenko@jetbrains.com> | 2014-09-29 17:16:42 +0200 |
commit | 91c64c5a9467d17665881010bc0d86d138b124f6 (patch) | |
tree | ce44b070457068145d072cfdc5753fbb386771e6 /src/org/jetbrains/java/decompiler | |
parent | 5349ad435b3659f2e58fec2a04d0e581456f2351 (diff) | |
download | fernflower-91c64c5a9467d17665881010bc0d86d138b124f6.tar fernflower-91c64c5a9467d17665881010bc0d86d138b124f6.tar.gz fernflower-91c64c5a9467d17665881010bc0d86d138b124f6.tar.lz fernflower-91c64c5a9467d17665881010bc0d86d138b124f6.tar.xz fernflower-91c64c5a9467d17665881010bc0d86d138b124f6.zip |
Cleanup (loop invariant optimization; formatting)
Diffstat (limited to 'src/org/jetbrains/java/decompiler')
-rw-r--r-- | src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java b/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java index 4821eab..26cc638 100644 --- a/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java +++ b/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java @@ -426,30 +426,28 @@ public class LabelHelper { HashSet<Statement> setContinue = new HashSet<Statement>(); if (stat.getExprents() == null) { - for(Statement st : stat.getStats()) { + for (Statement st : stat.getStats()) { HashSet<Statement>[] arr = processStatementLabel(st); setBreak.addAll(arr[0]); setContinue.addAll(arr[1]); } - boolean shieldtype = (stat.type == Statement.TYPE_DO || stat.type == Statement.TYPE_SWITCH); - - for(StatEdge edge : stat.getLabelEdges()) { - if (edge.explicit) { - if (shieldtype - && ((edge.getType() == StatEdge.TYPE_BREAK && setBreak.contains(edge.getSource())) || (edge.getType() == StatEdge.TYPE_CONTINUE && setContinue.contains(edge - .getSource())))) { + boolean shieldType = (stat.type == Statement.TYPE_DO || stat.type == Statement.TYPE_SWITCH); + if (shieldType) { + for (StatEdge edge : stat.getLabelEdges()) { + if (edge.explicit && ((edge.getType() == StatEdge.TYPE_BREAK && setBreak.contains(edge.getSource())) || + (edge.getType() == StatEdge.TYPE_CONTINUE && setContinue.contains(edge.getSource())))) { edge.labeled = false; } } } switch (stat.type) { - case Statement.TYPE_DO: - setContinue.clear(); - case Statement.TYPE_SWITCH: - setBreak.clear(); + case Statement.TYPE_DO: + setContinue.clear(); + case Statement.TYPE_SWITCH: + setBreak.clear(); } } |