func avgWeight(policies []*GameServerAllocationPolicy) int {
	if len(policies) == 0 {
		return 0
	}
	var sum int
	for _, policy := range policies {
		sum += policy.Spec.Weight
	}
	return sum / len(policies)
}
// avgWeight calculates average over allocation policy Weight field.
avgWeight calculates average over allocation policy Weight field.
// avgWeight calculates average over allocation policy Weight field .
func avgWeight(policies []*GameServerAllocationPolicy) int {
	if len(policies) == 0 {
		return 0
	}
	var sum int
	for _, policy := range policies {
		sum += policy.Spec.Weight
	}
	return sum / len(policies)
}
func avgWeight ( policies [ ] * GameServerAllocationPolicy ) int { if len ( policies ) == 0 { return 0 } var sum int for _ , policy := range policies { sum += policy . Spec . Weight } return sum / len ( policies ) }
avgWeight calculates average over allocation policy Weight field.
avgWeight calculates average over allocation policy Weight field .