From 0c31681d35e3deb0cea5626d022b143364c074be Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 23 Jul 2024 01:48:06 -0400 Subject: [PATCH] porkbun: Simplify array length check --- ddclient.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ddclient.in b/ddclient.in index 7300c08..f7a998a 100755 --- a/ddclient.in +++ b/ddclient.in @@ -6821,10 +6821,8 @@ sub nic_porkbun_update { } my $records = $response->{records}; if (ref($records) eq 'ARRAY' && defined $records->[0]->{'id'}) { - my $count = scalar(@{$records}); - if ($count > 1) { - warning("updating %s: There are multiple applicable records. Only first record is used. Overwrite all with the same content."); - } + warning("updating %s: There are multiple applicable records. Only first record is used. Overwrite all with the same content.") + if @$records > 1; my $current_content = $records->[0]->{'content'}; if ($current_content eq $ip) { $config{$h}{"status-ipv$ipv"} = "good";