MCPcopy Create free account
hub / github.com/DoNewsCode/core / fmtEdges

Method fmtEdges

dag/dag.go:112–122  ·  view source on GitHub ↗
(edges []int)

Source from the content-addressed store, hash-verified

110}
111
112func (d *DAG) fmtEdges(edges []int) interface{} {
113 var s []string
114 for _, edge := range edges {
115 if d.vertexes[edge].name != "" {
116 s = append(s, fmt.Sprintf("%d: %s", edge, d.vertexes[edge].name))
117 } else {
118 s = append(s, fmt.Sprintf("%d", edge))
119 }
120 }
121 return strings.Join(s, " -> ")
122}
123
124// order returns the total number of nodes in the graph
125func (d *DAG) order() int {

Callers 2

AddEdgeMethod · 0.95
AddEdgesMethod · 0.95

Calls 1

SprintfMethod · 0.65

Tested by

no test coverage detected