]> git.donarmstrong.com Git - perltidy.git/commitdiff
removed redundant data initializations from BEGIN blocks
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 24 Apr 2020 13:44:59 +0000 (06:44 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 24 Apr 2020 13:44:59 +0000 (06:44 -0700)
lib/Perl/Tidy/Formatter.pm
lib/Perl/Tidy/Tokenizer.pm

index b717e01093b1ad9639b2cf5532e187e8915aa041..0d8441360021f2f0d776bface3f34f2c33c9091b 100644 (file)
@@ -391,15 +391,6 @@ BEGIN {
     @q = qw< } ) ] >;
     @is_closing_token{@q} = (1) x scalar(@q);
 
-    # Patterns for standardizing matches to block types for regular subs and
-    # anonymous subs. Examples
-    #  'sub process' is a named sub
-    #  'sub ::m' is a named sub
-    #  'sub' is an anonymous sub
-    #  'sub:' is a label, not a sub
-    #  'substr' is a keyword
-    $SUB_PATTERN  = '^sub\s+(::|\w)';
-    $ASUB_PATTERN = '^sub$';
 }
 
 # whitespace codes
@@ -6308,6 +6299,13 @@ sub make_closing_side_comment_list_pattern {
 
 sub make_sub_matching_pattern {
 
+    # Patterns for standardizing matches to block types for regular subs and
+    # anonymous subs. Examples
+    #  'sub process' is a named sub
+    #  'sub ::m' is a named sub
+    #  'sub' is an anonymous sub
+    #  'sub:' is a label, not a sub
+    #  'substr' is a keyword
     $SUB_PATTERN  = '^sub\s+(::|\w)';
     $ASUB_PATTERN = '^sub$';
 
index 0677eeec4e372e21c418e9666d278be7ccf76cf0..fac2f7bfe3371bda954a1d5b4c58fb69216269eb 100644 (file)
@@ -7890,9 +7890,6 @@ BEGIN {
     @q = qw(q qq qw qx qr s y tr m);
     @is_q_qq_qw_qx_qr_s_y_tr_m{@q} = (1) x scalar(@q);
 
-    @q = qw(sub);
-    @is_sub{@q} = (1) x scalar(@q);
-
     @q = qw(package);
     @is_package{@q} = (1) x scalar(@q);