mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-09 09:03:12 +00:00
chore: fix test - avoid stackoverflow in populateparts
This commit is contained in:
@@ -275,8 +275,17 @@ public class Graph {
|
||||
return;
|
||||
}
|
||||
allParts.add(part);
|
||||
for (GraphPart p : part.nextParts) {
|
||||
populateParts(p, allParts);
|
||||
|
||||
Queue<GraphPart> q = new ArrayDeque<>();
|
||||
q.offer(part);
|
||||
while (!q.isEmpty()) {
|
||||
part = q.poll();
|
||||
for (GraphPart p : part.nextParts) {
|
||||
if (!allParts.contains(p)) {
|
||||
allParts.add(p);
|
||||
q.offer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user