mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-28 14:45:35 +00:00
Fixed: #2636 ActionScript - switches vs loop breaks
This commit is contained in:
@@ -1433,11 +1433,10 @@ public class Graph {
|
||||
* @return Second pass data or null
|
||||
*/
|
||||
protected SecondPassData prepareSecondPass(BaseLocalData localData, List<GraphTargetItem> list) {
|
||||
if (localData.allSwitchParts.isEmpty() && !localData.gotosUsed.getVal()) {
|
||||
if (!localData.gotosUsed.getVal()) {
|
||||
return null;
|
||||
}
|
||||
SecondPassData spd = new SecondPassData();
|
||||
spd.allSwitchParts.addAll(localData.allSwitchParts);
|
||||
return spd;
|
||||
}
|
||||
|
||||
@@ -2998,19 +2997,7 @@ public class Graph {
|
||||
Map<GraphPart, Integer> count = new HashMap<>();
|
||||
GraphPart winner = null;
|
||||
int winnerCount = 0;
|
||||
int winnerNumBlock = Integer.MAX_VALUE;
|
||||
|
||||
Set<GraphPart> bannedCandidates = new HashSet<>();
|
||||
if (localData.secondPassData != null) {
|
||||
bannedCandidates = localData.secondPassData.allSwitchParts;
|
||||
}
|
||||
|
||||
if (debugPrintLoopList) {
|
||||
System.err.println("bannedCandidates:");
|
||||
for (GraphPart p : bannedCandidates) {
|
||||
System.err.println("- " + p);
|
||||
}
|
||||
}
|
||||
int winnerNumBlock = Integer.MAX_VALUE;
|
||||
|
||||
for (GraphPart cand : currentLoop.breakCandidates) {
|
||||
if (removedX.contains(cand)) {
|
||||
@@ -3019,12 +3006,6 @@ public class Graph {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (bannedCandidates.contains(cand)) {
|
||||
if (debugPrintLoopList) {
|
||||
System.err.println("cand " + cand + " is banned");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (!count.containsKey(cand)) {
|
||||
count.put(cand, 0);
|
||||
}
|
||||
@@ -4956,8 +4937,6 @@ public class Graph {
|
||||
}
|
||||
}
|
||||
|
||||
localData.allSwitchParts.add(caseBodies.get(i));
|
||||
|
||||
List<GraphPart> stopPart2x = new ArrayList<>(stopPart);
|
||||
List<StopPartKind> stopPartKind2x = new ArrayList<>(stopPartKind);
|
||||
for (GraphPart b : caseBodies) {
|
||||
|
||||
Reference in New Issue
Block a user