Merge pull request #7026 from eugenp/graph-fix

fix remove vertex
This commit is contained in:
Loredana Crusoveanu
2019-05-29 21:56:53 +03:00
committed by GitHub
2 changed files with 16 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ public class Graph {
void removeVertex(String label) {
Vertex v = new Vertex(label);
adjVertices.values().stream().map(e -> e.remove(v)).collect(Collectors.toList());
adjVertices.values().stream().forEach(e -> e.remove(v));
adjVertices.remove(new Vertex(label));
}