MCPcopy Create free account
hub / github.com/google/pprof / Sort

Method Sort

internal/graph/graph.go:1136–1144  ·  view source on GitHub ↗

Sort returns a slice of the edges in the map, in a consistent order. The sort order is first based on the edge weight (higher-to-lower) and then by the node names to avoid flakiness.

()

Source from the content-addressed store, hash-verified

1134// order. The sort order is first based on the edge weight
1135// (higher-to-lower) and then by the node names to avoid flakiness.
1136func (e EdgeMap) Sort() []*Edge {
1137 el := make(edgeList, 0, len(e))
1138 for _, w := range e {
1139 el = append(el, w)
1140 }
1141
1142 sort.Sort(el)
1143 return el
1144}
1145
1146// Sum returns the total weight for a set of nodes.
1147func (e EdgeMap) Sum() int64 {

Callers 1

ComposeDotFunction · 0.95

Calls 1

SortMethod · 0.45

Tested by

no test coverage detected