sortSCCsByMin sorts a slice of SCC indices in place by the lex-smallest sortKey among each SCC's members. Stable ordering.
(indices []int, sccs [][]*objectEntry)
| 497 | // sortSCCsByMin sorts a slice of SCC indices in place by the lex-smallest |
| 498 | // sortKey among each SCC's members. Stable ordering. |
| 499 | func sortSCCsByMin(indices []int, sccs [][]*objectEntry) { |
| 500 | slices.SortStableFunc(indices, func(a, b int) int { |
| 501 | return cmp.Compare(minSortKey(sccs[a]), minSortKey(sccs[b])) |
| 502 | }) |
| 503 | } |
| 504 | |
| 505 | func minSortKey(scc []*objectEntry) string { |
| 506 | if len(scc) == 0 { |
no test coverage detected