'Switch' statements with single case converted to 'if', other warnings fixed

This commit is contained in:
Tagir Valeev
2018-10-01 15:43:04 +07:00
parent c7bdab8b00
commit 32674967de
2 changed files with 28 additions and 30 deletions

View File

@@ -80,8 +80,7 @@ public class ExitHelper {
} }
} }
switch (stat.type) { if (stat.type == Statement.TYPE_IF) {
case Statement.TYPE_IF:
IfStatement ifst = (IfStatement)stat; IfStatement ifst = (IfStatement)stat;
if (ifst.getIfstat() == null) { if (ifst.getIfstat() == null) {
StatEdge ifedge = ifst.getIfEdge(); StatEdge ifedge = ifst.getIfEdge();

View File

@@ -376,8 +376,7 @@ public class MergeHelper {
return stat; return stat;
} }
switch (stat.type) { if (stat.type == Statement.TYPE_SEQUENCE) {
case Statement.TYPE_SEQUENCE:
for (int i = stat.getStats().size() - 1; i >= 0; i--) { for (int i = stat.getStats().size() - 1; i >= 0; i--) {
Statement tmp = getLastDirectData(stat.getStats().get(i)); Statement tmp = getLastDirectData(stat.getStats().get(i));
if (tmp == null || !tmp.getExprents().isEmpty()) { if (tmp == null || !tmp.getExprents().isEmpty()) {