-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace "ifs" with "switch/case" #10625
Conversation
LGTM [test] |
} | ||
if deployerErr == nil && deployer != nil { | ||
|
||
default: /* deployerErr == nil */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lost the deployer != nil
check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was redundant. It will always be non-nil if deployerErr is nil:
func (c *DeploymentController) getPod(namespace, name string) (*kapi.Pod, error) { |
@Kargakis PTAL |
LGTM, squash down to one commit. We are on a code freeze for the next few weeks so this will get some time to merge. |
@zhaosijun can you update this and drop the merge commits? |
@Kargakis OK. Thank you for reminding me. |
de0484b
to
10f3281
Compare
LGTM [merge] |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11932/) (Image: devenv-rhel7_5466) |
flaked on #11094 |
[merge] |
Evaluated for origin merge up to 10f3281 |
[Test]ing while waiting on the merge queue |
Evaluated for origin test up to 10f3281 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/11932/) (Base Commit: 1023112) |
I think code here using "switch/case" like code in "case deployapi.DeploymentStatusPending, deployapi.DeploymentStatusRunning:" maybe be a little more favorable.