Skip to content

Commit

Permalink
Refactored to memory efficient
Browse files Browse the repository at this point in the history
Signed-off-by: t-kikuc <[email protected]>
  • Loading branch information
t-kikuc committed Dec 27, 2023
1 parent fa63127 commit 1293ece
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/app/piped/platformprovider/ecs/routing_traffic.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ func (c RoutingTrafficConfig) hasSameTargets(forwardActionTargets []types.Target
return false
}

cMap := make(map[string]bool)
cMap := make(map[string]struct{})
for _, item := range c {
cMap[item.TargetGroupArn] = true
cMap[item.TargetGroupArn] = struct{}{}
}

for _, target := range forwardActionTargets {
if !cMap[*target.TargetGroupArn] {
if _, ok := cMap[*target.TargetGroupArn]; !ok {
return false
}
}
Expand Down

0 comments on commit 1293ece

Please sign in to comment.