embed.pl: Swap order of conditionals

It is easier to understand when the nearly trivial case is gotten out of
the way first.
This commit is contained in:
Karl Williamson 2026-01-04 08:59:59 -07:00 committed by Karl Williamson
parent 46c37430a0
commit e4cec3d716

View File

@ -5007,8 +5007,19 @@ sub find_undefs {
# declarations
next unless $line->{type} eq 'content';
# First, for #defines.
if ($line->{sub_type} eq '#define') {
# Everything but #defines. All we care about are visibility
# declarations.
if ($line->{sub_type} ne '#define') {
next unless $line->{sub_type} eq 'text';
# Only comments have apidoc lines.
next unless $line->{flat} eq "";
next unless $line->{line} =~ / ^ =for \s+ apidoc /mx;
process_apidoc_lines($hdr, split /\n/, $line->{line});
}
else {
# HeaderParser stripped off most everything.
my $name = $line->{flat};
@ -5055,17 +5066,6 @@ sub find_undefs {
$always_undefs{$name} = 1;
}
else {
# Otherwise check for a visibility declaration.
next unless $line->{sub_type} eq 'text';
# Only comments have apidoc lines.
next unless $line->{flat} eq "";
next unless $line->{line} =~ / ^ =for \s+ apidoc /mx;
process_apidoc_lines($hdr, split /\n/, $line->{line});
}
}
} # Done with headers