Code cleanup

This commit is contained in:
Clint Shryock 2015-03-11 08:30:43 -05:00
parent 3977256c17
commit 902ca25f36
1 changed files with 4 additions and 8 deletions

View File

@ -320,15 +320,11 @@ func resourceAwsSecurityGroupIPPermGather(d *schema.ResourceData, permissions []
ruleMap := make(map[string]map[string]interface{})
for _, perm := range permissions {
var fromPort, toPort int
if perm.FromPort == nil {
fromPort = 0
} else {
fromPort = *perm.FromPort
if v := perm.FromPort; v != nil {
fromPort = *v
}
if perm.ToPort == nil {
toPort = 0
} else {
toPort = *perm.ToPort
if v := perm.ToPort; v != nil {
toPort = *v
}
k := fmt.Sprintf("%s-%d-%d", *perm.IPProtocol, fromPort, toPort)