From 0f11172af4b1a2d71af28067534bad978727d75f Mon Sep 17 00:00:00 2001 From: Dmitry Kryukov Date: Sun, 14 Jul 2024 21:00:29 +0300 Subject: [PATCH] Improvement: removed collection which is updated, but never queried --- .../org/logstash/config/ir/graph/algorithms/BreadthFirst.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/BreadthFirst.java b/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/BreadthFirst.java index 0c16c171614..3a012f0dff0 100644 --- a/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/BreadthFirst.java +++ b/logstash-core/src/main/java/org/logstash/config/ir/graph/algorithms/BreadthFirst.java @@ -38,7 +38,6 @@ public static BfsResult breadthFirst(Collection roots, Consumer> consumer ) { Map vertexDistances = new HashMap<>(); - Map vertexParents = new HashMap<>(); Deque queue = new ArrayDeque<>(roots); roots.forEach(v -> vertexDistances.put(v, 0)); @@ -55,7 +54,6 @@ public static BfsResult breadthFirst(Collection roots, nextVertices.forEach(nextVertex -> { if (vertexDistances.get(nextVertex) == null) { vertexDistances.put(nextVertex, currentDistance+1); - vertexParents.put(nextVertex, currentVertex); queue.push(nextVertex); } });