MCPcopy Create free account
hub / github.com/HashLoad/boss / AddEdge

Method AddEdge

core/compiler/graphs/graph.go:79–92  ·  view source on GitHub ↗
(nLeft, nRight *Node)

Source from the content-addressed store, hash-verified

77}
78
79func (g *GraphItem) AddEdge(nLeft, nRight *Node) {
80 g.lock()
81 if g.depends == nil {
82 g.depends = make(map[string][]*Node)
83 g.usedBy = make(map[string][]*Node)
84 }
85 if !contains(g.depends[nLeft.Value], nRight) {
86 g.depends[nLeft.Value] = append(g.depends[nLeft.Value], nRight)
87 }
88 if !contains(g.usedBy[nRight.Value], nLeft) {
89 g.usedBy[nRight.Value] = append(g.usedBy[nRight.Value], nLeft)
90 }
91 g.unlock()
92}
93
94func (g *GraphItem) String() {
95 g.lock()

Callers 1

loadGraphFunction · 0.80

Calls 3

lockMethod · 0.95
unlockMethod · 0.95
containsFunction · 0.85

Tested by

no test coverage detected