MCPcopy Create free account
hub / github.com/github/gh-aw / computeValueMax

Method computeValueMax

pkg/github/label_objective_mapping.go:110–119  ·  view source on GitHub ↗

computeValueMax returns the highest value among all matching labels.

(matchingValues []int, matchedLabels []string)

Source from the content-addressed store, hash-verified

108
109// computeValueMax returns the highest value among all matching labels.
110func (om *ObjectiveMapping) computeValueMax(matchingValues []int, matchedLabels []string) int {
111 maxVal := matchingValues[0]
112 for _, v := range matchingValues {
113 if v > maxVal {
114 maxVal = v
115 }
116 }
117 labelObjectiveMappingLog.Printf("Computed objective value via max: labels=%v, value=%d", matchedLabels, maxVal)
118 return maxVal
119}
120
121// DefaultObjectiveMapping returns the built-in default label-to-value mapping.
122func DefaultObjectiveMapping() *ObjectiveMapping {

Callers 1

ComputeObjectiveValueMethod · 0.95

Calls 1

PrintfMethod · 0.45

Tested by

no test coverage detected