Skip to content

Commit

Permalink
refactor: simplify middleware code
Browse files Browse the repository at this point in the history
following code review feedback. pkg/middlewares/aws_route_table_expander.go
  • Loading branch information
sundowndev committed Apr 7, 2021
1 parent c671651 commit 0e001f2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pkg/middlewares/aws_route_table_expander.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,9 @@ func (m *AwsRouteTableExpander) handleDefaultTable(table *aws.AwsDefaultRouteTab

func (m *AwsRouteTableExpander) routeExists(routeId string, resourcesFromState []resource.Resource) bool {
for _, res := range resourcesFromState {
if res.TerraformType() != aws.AwsRouteResourceType {
continue
if res.TerraformType() == aws.AwsRouteResourceType && res.TerraformId() == routeId {
return true
}

if res.TerraformId() != routeId {
continue
}

return true
}

return false
Expand Down

0 comments on commit 0e001f2

Please sign in to comment.