using HashSet in Graph.leadsTo

This commit is contained in:
honfika@gmail.com
2015-07-15 22:37:44 +02:00
parent a61ff138ea
commit 36e7bdbaee

View File

@@ -19,6 +19,7 @@ package com.jpexs.decompiler.graph;
import com.jpexs.decompiler.flash.BaseLocalData;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
/**
@@ -123,7 +124,7 @@ public class GraphPart implements Serializable {
return time;
}
private boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart part, List<GraphPart> visited, List<Loop> loops) throws InterruptedException {
private boolean leadsTo(BaseLocalData localData, Graph gr, GraphSource code, GraphPart part, HashSet<GraphPart> visited, List<Loop> loops) throws InterruptedException {
if (Thread.currentThread().isInterrupted()) {
throw new InterruptedException();
}
@@ -192,7 +193,7 @@ public class GraphPart implements Serializable {
for (Loop l : loops) {
l.leadsToMark = 0;
}
return leadsTo(localData, gr, code, part, new ArrayList<>(), loops);
return leadsTo(localData, gr, code, part, new HashSet<>(), loops);
}
public GraphPart(int start, int end) {