From 75552f80f7ae1aa5bb88755b4d148bf778cde12c Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 23 Aug 2024 21:43:54 -0400 Subject: [PATCH] nic_updateable: Don't mutate `status-ipv*` vars if not updating This simplifies the logic a bit and improves readability. --- ddclient.in | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ddclient.in b/ddclient.in index a834e74..959f8a6 100755 --- a/ddclient.in +++ b/ddclient.in @@ -3607,15 +3607,12 @@ sub nic_updateable { } } - delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6); if ($update) { $config{$host}{'update'} = 1; $config{$host}{'atime'} = $now; - delete($config{$host}{$_}) for qw(wtime warned-min-interval warned-min-error-interval); + delete($config{$host}{$_}) for qw(status-ipv4 status-ipv6 wtime + warned-min-interval warned-min-error-interval); } else { - for (qw(status-ipv4 status-ipv6)) { - $config{$host}{$_} = $recap{$host}{$_} if defined($recap{$host}{$_}); - } delete($config{$host}{$_}) for qw(wantipv4 wantipv6); }