This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
devel/mktodo.pl: Reorder else clauses
authorKarl Williamson <khw@cpan.org>
Mon, 15 Jul 2019 20:25:58 +0000 (14:25 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:31 +0000 (16:39 -0600)
This makes the trivial (short) case first, so it's easier to read

(cherry picked from commit 9f3102880cda991067d28d7f59759bc4005f886a)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/devel/mktodo.pl

index db6e719..e3cd3a3 100644 (file)
@@ -410,15 +410,16 @@ sub get_apicheck_symbol_map
 
   while (<$fh>) {
     next if /^#/;
-    if (defined $cur) {
+
+    if (! defined $cur) {
+      /_DPPP_test_(\w+)/ and $cur = $1;
+    }
+    else {
       for my $sym (/\b([A-Za-z_]\w+)\b/g) {
         $symmap{$sym}{$cur}++;
       }
       undef $cur if /^}$/;
     }
-    else {
-      /_DPPP_test_(\w+)/ and $cur = $1;
-    }
   }
 
   return \%symmap;