Fix visited set bug in Graph class and refactor GenericNode component (#1917)

* format

* chore: Fix visited set bug in Graph class

* Refactor GenericNode component to improve build status handling
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-05-17 15:28:02 -07:00 • committed by GitHub
commit c3353bec37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 35 additions and 31 deletions

View file

@ -468,9 +468,9 @@ class Graph:
"""Marks a branch of the graph."""
if visited is None:
visited = set()
visited.add(vertex_id)
if vertex_id in visited:
return
visited.add(vertex_id)
self.mark_vertex(vertex_id, state)