From: Steve Hancock Date: Tue, 3 Nov 2020 03:59:04 +0000 (-0800) Subject: minor Tokenizer speedups X-Git-Tag: 20201001.03~11 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=23ae6089863eff63f529edbcb3fb949fb8bfef59;p=perltidy.git minor Tokenizer speedups --- diff --git a/lib/Perl/Tidy/Tokenizer.pm b/lib/Perl/Tidy/Tokenizer.pm index 49b0ba78..5454ee52 100644 --- a/lib/Perl/Tidy/Tokenizer.pm +++ b/lib/Perl/Tidy/Tokenizer.pm @@ -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;