diff --git a/balancer.go b/balancer.go index 473deef..d6d035c 100644 --- a/balancer.go +++ b/balancer.go @@ -11,7 +11,7 @@ type balancePenalty struct { } func BestNodeByPenalties(nodes []*Node) (*Node, error) { - penalties := make([]*balancePenalty, len(nodes)) + penalties := make([]balancePenalty, len(nodes)) var playerPenalty, cpuPenalty, deficitFramePenalty, nullFramePenalty int @@ -32,7 +32,7 @@ func BestNodeByPenalties(nodes []*Node) (*Node, error) { } } - penalties[i] = &balancePenalty{node, playerPenalty + cpuPenalty + deficitFramePenalty + nullFramePenalty} + penalties[i] = balancePenalty{node, playerPenalty + cpuPenalty + deficitFramePenalty + nullFramePenalty} } sort.SliceStable(penalties, func(i, j int) bool {