two optimizations

- removed unnecessary return statements
- optimized HTTP response code evaluations as numeric comparisons
This commit is contained in:
Jack Francis
2017-06-01 13:58:11 -07:00
parent c95af06154
commit 17f8dc53af
4 changed files with 13 additions and 27 deletions

View File

@@ -80,7 +80,7 @@ func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *clo
if shouldRetryAPIRequest(resp, err) {
retryErr := az.CreateOrUpdateRouteTableWithRetry(routeTable)
if retryErr != nil {
return retryErr
err = retryErr
}
}
if err != nil {
@@ -113,7 +113,7 @@ func (az *Cloud) CreateRoute(clusterName string, nameHint string, kubeRoute *clo
if shouldRetryAPIRequest(resp, err) {
retryErr := az.CreateOrUpdateRouteWithRetry(route)
if retryErr != nil {
return retryErr
err = retryErr
}
}
if err != nil {
@@ -134,7 +134,7 @@ func (az *Cloud) DeleteRoute(clusterName string, kubeRoute *cloudprovider.Route)
if shouldRetryAPIRequest(resp, err) {
retryErr := az.DeleteRouteWithRetry(routeName)
if retryErr != nil {
return retryErr
err = retryErr
}
}
if err != nil {