read_recap: Invert condition (for readability)

This commit is contained in:
Richard Hansen 2024-08-28 02:26:17 -04:00
parent c2db690efb
commit cf54da50e4

View file

@ -1599,26 +1599,25 @@ sub read_recap {
my $config = shift;
my $globals = {};
%{$config} = ();
if (-e $file) {
return if !(-e $file);
my %saved = %opt;
%opt = ();
$saved_recap = _read_config($config, $globals, "##\\s*$program-$version\\s*", $file);
%opt = %saved;
for my $h (keys(%recap)) {
next if !exists($config->{$h});
# TODO: Why is this limited to this set of variables? Why not copy every recap var
# defined for the host's protocol?
# TODO: Why is this limited to this set of variables? Why not copy every recap var defined
# for the host's protocol?
for (qw(atime mtime wtime ip ipv4 ipv6 status-ipv4 status-ipv6)) {
# TODO: Isn't $config equal to \%recap here? If so, this is a no-op. What was the
# original intention behind this? To copy %recap values into %config? If so, is
# it better to just delete this and live with the current behavior (which doesn't
# seem to be causing users any problems) or to "fix" it to match the original
# intention, which might introduce a bug?
# original intention behind this? To copy %recap values into %config? If so, is it
# better to just delete this and live with the current behavior (which doesn't seem to
# be causing users any problems) or to "fix" it to match the original intention, which
# might introduce a bug?
$config->{$h}{$_} = $recap{$h}{$_} if exists $recap{$h}{$_};
}
}
}
}
######################################################################
## parse_assignments(string) return (rest, %variables)
## parse_assignment(string) return (name, value, rest)