]> git.donarmstrong.com Git - perltidy.git/commitdiff
eliminate last uses of each builtin
authorSteve Hancock <perltidy@users.sourceforge.net>
Sun, 7 Apr 2024 04:38:44 +0000 (21:38 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Sun, 7 Apr 2024 04:38:44 +0000 (21:38 -0700)
lib/Perl/Tidy/HtmlWriter.pm

index 5c2189786ecdc28f9cd57bc98ec605a83c51b7fb..695b340cc122012b85bb2e0c1d760a6e4a5ee1fc 100644 (file)
@@ -476,7 +476,8 @@ sub make_abbreviated_names {
     my ( $class, $rexpansion ) = @_;
 
     # abbreviations for color/bold/italic properties
-    while ( my ( $short_name, $long_name ) = each %short_to_long_names ) {
+    foreach my $short_name ( keys %short_to_long_names ) {
+        my $long_name = $short_to_long_names{$short_name};
         ${$rexpansion}{"hc$short_name"}  = ["html-color-$long_name"];
         ${$rexpansion}{"hb$short_name"}  = ["html-bold-$long_name"];
         ${$rexpansion}{"hi$short_name"}  = ["html-italic-$long_name"];
@@ -548,7 +549,8 @@ sub check_options {
     # setup property lookup tables for tokens based on their short names
     # every token type has a short name, and will use these tables
     # to do the html markup
-    while ( my ( $short_name, $long_name ) = each %short_to_long_names ) {
+    foreach my $short_name ( keys %short_to_long_names ) {
+        my $long_name = $short_to_long_names{$short_name};
         $html_color{$short_name}  = $rOpts->{"html-color-$long_name"};
         $html_bold{$short_name}   = $rOpts->{"html-bold-$long_name"};
         $html_italic{$short_name} = $rOpts->{"html-italic-$long_name"};