From 8efc77cacce222e259b2b0b923c0d6696d482f27 Mon Sep 17 00:00:00 2001 From: Tyler Date: Sun, 13 Oct 2019 04:45:33 -0400 Subject: [PATCH] No need to use pointers in this context --- balancer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 {