Delete unnecessary defined()
check
This commit is contained in:
parent
478f517d53
commit
5a66efe79e
1 changed files with 2 additions and 6 deletions
|
@ -1959,15 +1959,11 @@ sub init_config {
|
|||
delete($globals{$k});
|
||||
next;
|
||||
}
|
||||
# TODO: Isn't $globals{$k} guaranteed to be defined here? Otherwise $k wouldn't appear in
|
||||
# %globals.
|
||||
my $ovalue = $globals{$k} // $def->{'default'};
|
||||
# _read_config already checked any value from the config file, so the purpose of this check
|
||||
# is to validate command-line options which were merged into %globals above.
|
||||
# TODO: Move this check to where the command-line options are actually processed.
|
||||
if (!eval { $globals{$k} = check_value($ovalue, $def); 1; }) {
|
||||
$ovalue //= '(not set)';
|
||||
warning("ignoring invalid variable value '$k=$ovalue': $@");
|
||||
if (!eval { $globals{$k} = check_value($globals{$k}, $def); 1; }) {
|
||||
warning("ignoring invalid variable value '$k=$globals{$k}': $@");
|
||||
if ($def->{'required'}) {
|
||||
# TODO: What's the point of this? The opt() function will fall back to the default
|
||||
# value if $globals{$k} is undefined.
|
||||
|
|
Loading…
Reference in a new issue