porkbun: Simplify array length check

This commit is contained in:
Richard Hansen 2024-07-23 01:48:06 -04:00
parent 16b15ea089
commit 0c31681d35

View file

@ -6821,10 +6821,8 @@ sub nic_porkbun_update {
} }
my $records = $response->{records}; my $records = $response->{records};
if (ref($records) eq 'ARRAY' && defined $records->[0]->{'id'}) { if (ref($records) eq 'ARRAY' && defined $records->[0]->{'id'}) {
my $count = scalar(@{$records}); warning("updating %s: There are multiple applicable records. Only first record is used. Overwrite all with the same content.")
if ($count > 1) { if @$records > 1;
warning("updating %s: There are multiple applicable records. Only first record is used. Overwrite all with the same content.");
}
my $current_content = $records->[0]->{'content'}; my $current_content = $records->[0]->{'content'};
if ($current_content eq $ip) { if ($current_content eq $ip) {
$config{$h}{"status-ipv$ipv"} = "good"; $config{$h}{"status-ipv$ipv"} = "good";