Skip to content

Commit 21e6471

Browse files
committed
ParseXS: refactor: fetch_para(): remove POD loop
Remove the loop which says 'foreach contiguous section of pod, delete it'. Replace it with with something which removes just *one* section of POD, then relies on the main loop to process the next line, which may well be the start of another POD section. Fewer nested loops is less cognitive load. Should be no functional changes.
1 parent 7c7e63d commit 21e6471

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,9 @@ sub fetch_para {
616616

617617
for (;;) {
618618

619-
# Skip any embedded POD sections, reading in lines from {in_fh} as
620-
# necessary.
619+
# Skip an embedded POD section
621620

622-
while ($self->{lastline} =~ /^=/) {
621+
if ($self->{lastline} =~ /^=/) {
623622
while ($self->{lastline} = readline($self->{in_fh})) {
624623
last if ($self->{lastline} =~ /^=cut\s*$/);
625624
}
@@ -629,6 +628,7 @@ sub fetch_para {
629628
return 0 unless defined $self->{lastline};
630629
chomp $self->{lastline};
631630
$self->{lastline} =~ s/^\s+$//;
631+
next;
632632
}
633633

634634
# if present, extract out a TYPEMAP block as a paragraph

0 commit comments

Comments
 (0)