Skip to content

Commit

Permalink
Include self-cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanJarv committed Aug 22, 2024
1 parent 308dd60 commit a0a4312
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lib/graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ type Graph[T Value] struct {

// The AddEdge method adds an edge between two vertices in the graph
func (g *Graph[T]) AddEdge(k1, k2 T) {
// Avoid self-cycles
if k1.Id() == k2.Id() {
return
}

n1, ok := g.getNode(k1.Id())
if !ok {
n1 = g.AddNode(k1)
Expand Down

0 comments on commit a0a4312

Please sign in to comment.