infomaniak: Delete unnecessary defined checks

`undef` is falsy so there's no need to check whether the value is
defined.
This commit is contained in:
Richard Hansen 2024-06-25 21:56:12 -04:00
parent bab9d9483e
commit ac9f937c88

View file

@ -8022,14 +8022,14 @@ sub nic_infomaniak_update {
for my $url ($url1, $url2) { for my $url ($url1, $url2) {
info("trying update with %s", $url); info("trying update with %s", $url);
my $reply = geturl(proxy => opt('proxy'), url => $url); my $reply = geturl(proxy => opt('proxy'), url => $url);
if (!defined($reply) || !$reply) { if (!$reply) {
info("could not update %s using url %s, trying next one", $h, $url); info("could not update %s using url %s, trying next one", $h, $url);
next; next;
} }
my ($status) = split / /, $reply, 1; my ($status) = split / /, $reply, 1;
my ($updated, $msg) = my ($updated, $msg) =
$statuses{$status} // (0, sprintf("Unknown reply from Infomaniak: %s", $reply)); $statuses{$status} // (0, sprintf("Unknown reply from Infomaniak: %s", $reply));
if (defined $updated && $updated) { if ($updated) {
info($msg); info($msg);
$config{$h}{"ipv$v"} = $ip; $config{$h}{"ipv$v"} = $ip;
$config{$h}{'mtime'} = $now; $config{$h}{'mtime'} = $now;