Skip to content

Commit

Permalink
test tweaks; cycle detection not really working?
Browse files Browse the repository at this point in the history
  • Loading branch information
wcharczuk committed Feb 15, 2024
1 parent 2feca44 commit f6b8f1b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion link_test.go

This file was deleted.

14 changes: 0 additions & 14 deletions list_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,3 @@ func remove[A INode](nodes []A, id Identifier) []A {
}
return output
}

func hasKey[A INode](nodes []A, id Identifier) bool {
for _, n := range nodes {
if n.Node().id == id {
return true
}
}
return false
}

func mapHasKey[K comparable, V any](m map[K]V, k K) (ok bool) {
_, ok = m[k]
return
}
14 changes: 14 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,17 @@ func dumpDot(g *Graph, path string) error {
}
return nil
}

func hasKey[A INode](nodes []A, id Identifier) bool {
for _, n := range nodes {
if n.Node().id == id {
return true
}
}
return false
}

func mapHasKey[K comparable, V any](m map[K]V, k K) (ok bool) {
_, ok = m[k]
return
}

0 comments on commit f6b8f1b

Please sign in to comment.