diff --git a/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/TopologicalSort.java b/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/TopologicalSort.java index 21b95966c00..b8927fe5351 100644 --- a/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/TopologicalSort.java +++ b/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/TopologicalSort.java @@ -41,8 +41,7 @@ public static List sortVertices(Graph g) throws UnexpectedGraphCycleErro List sorted = new ArrayList<>(g.getVertices().size()); - Deque pending = new LinkedList<>(); - pending.addAll(g.getRoots()); + Deque pending = new LinkedList<>(g.getRoots()); Set traversedEdges = new HashSet<>();