MCPcopy Index your code
hub / github.com/cloudfoundry/cli / Sort

Method Sort

actor/v7action/process_summary.go:38–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38func (ps ProcessSummaries) Sort() {
39 sort.Slice(ps, func(i int, j int) bool {
40 var iScore int
41 var jScore int
42
43 switch ps[i].Type {
44 case constant.ProcessTypeWeb:
45 iScore = 0
46 default:
47 iScore = 1
48 }
49
50 switch ps[j].Type {
51 case constant.ProcessTypeWeb:
52 jScore = 0
53 default:
54 jScore = 1
55 }
56
57 if iScore == 1 && jScore == 1 {
58 return ps[i].Type < ps[j].Type
59 }
60 return iScore < jScore
61 })
62}
63
64func (ps ProcessSummaries) String() string {
65 ps.Sort()

Callers 11

StringMethod · 0.95
ExecuteMethod · 0.45
ExecuteMethod · 0.45
marketplaceMethod · 0.45
ExecuteMethod · 0.45
toStringMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected