]> git.donarmstrong.com Git - perltidy.git/commitdiff
minor Tokenizer speedups
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 3 Nov 2020 03:59:04 +0000 (19:59 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 3 Nov 2020 03:59:04 +0000 (19:59 -0800)
lib/Perl/Tidy/Tokenizer.pm

index 49b0ba78d8e94ddbc2b70d8d61d470f3bd0ae81c..5454ee52984fa10e0b1eaa5ad8530b5fc2afa614 100644 (file)
@@ -3013,7 +3013,7 @@ EOM
                 }
             }
 
-            unless ( $tok =~ /^\s*$/ || $tok eq 'CORE::' ) {
+            unless ( $type eq 'b' || $tok eq 'CORE::' ) {
 
                 # try to catch some common errors
                 if ( ( $type eq 'n' ) && ( $tok ne '0' ) ) {
@@ -6172,7 +6172,8 @@ sub scan_identifier_do {
     my $message             = "";
     my $tok_is_blank;    # a flag to speed things up
 
-    my $in_prototype_or_signature = $container_type =~ /^sub\b/;
+    my $in_prototype_or_signature =
+      $container_type && $container_type =~ /^sub\b/;
 
     # these flags will be used to help figure out the type:
     my $saw_alpha;