Skip to content

Commit

Permalink
cleanup: code simplification in get_master_score
Browse files Browse the repository at this point in the history
Merge two different condition leading to the same result together.
This make the code actually simpler to understand and removes a
step.
  • Loading branch information
ioguix committed Nov 13, 2019
1 parent b55a5e5 commit b508f82
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions script/pgsqlms
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,10 @@ sub _get_master_score {

$score = qx{ $CRM_MASTER --quiet --get-value $node_arg 2> /dev/null };

return '' unless $? == 0;
return '' unless $? == 0 and defined $score;

chomp $score;

$score = '' unless defined $score;

return $score;
}

Expand Down

0 comments on commit b508f82

Please sign in to comment.