[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Wed Apr 6 13:39:27 UTC 2016


The branch master has been updated
       via  2110febb117f477cbcaf6c8fe724848b57f5d433 (commit)
      from  1c9f511793ad2fa8249a0d010cf2471769d5cd29 (commit)


- Log -----------------------------------------------------------------
commit 2110febb117f477cbcaf6c8fe724848b57f5d433
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Apr 6 15:02:57 2016 +0200

    Perl cleanup: don't create lists unnecessarily
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Configurations/common.tmpl | 28 ++++++++++++++++++----------
 Configure                  | 10 +++++-----
 2 files changed, 23 insertions(+), 15 deletions(-)

diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index 9c80070..f5c3920 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -96,12 +96,16 @@
                                          @{$unified_info{shared_sources}->{$lib}}) ],
                               deps => [ reducedepends(resolvedepends($lib)) ],
                               %ordinals);
-         map { doobj($_, $lib, intent => "lib") } @{$unified_info{shared_sources}->{$lib}};
+         foreach (@{$unified_info{shared_sources}->{$lib}}) {
+             doobj($_, $lib, intent => "lib");
+         }
      }
      $OUT .= obj2lib(lib => $lib,
                      objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
                                @{$unified_info{sources}->{$lib}} ]);
-     map { doobj($_, $lib, intent => "lib") } @{$unified_info{sources}->{$lib}};
+     foreach (@{$unified_info{sources}->{$lib}}) {
+         doobj($_, $lib, intent => "lib");
+     }
      $cache{$lib} = 1;
  }
 
@@ -116,8 +120,10 @@
                                (@{$unified_info{sources}->{$lib}},
                                 @{$unified_info{shared_sources}->{$lib}}) ],
                      deps => [ resolvedepends($lib) ]);
-     map { doobj($_, $lib, intent => "dso") } (@{$unified_info{sources}->{$lib}},
-                                               @{$unified_info{shared_sources}->{$lib}});
+     foreach ((@{$unified_info{sources}->{$lib}},
+               @{$unified_info{shared_sources}->{$lib}})) {
+         doobj($_, $lib, intent => "dso");
+     }
      $cache{$lib} = 1;
  }
 
@@ -131,7 +137,9 @@
                      objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
                                @{$unified_info{sources}->{$bin}} ],
                      deps => $deps);
-     map { doobj($_, $bin, intent => "bin") } @{$unified_info{sources}->{$bin}};
+     foreach (@{$unified_info{sources}->{$bin}}) {
+         doobj($_, $bin, intent => "bin");
+     }
      $cache{$bin} = 1;
  }
 
@@ -150,12 +158,12 @@
 
  # Build all known libraries, engines, programs and scripts.
  # Everything else will be handled as a consequence.
- map { dolib($_) } @{$unified_info{libraries}};
- map { doengine($_) } @{$unified_info{engines}};
- map { dobin($_) } @{$unified_info{programs}};
- map { doscript($_) } @{$unified_info{scripts}};
+ dolib($_)     foreach @{$unified_info{libraries}};
+ doengine($_)  foreach @{$unified_info{engines}};
+ dobin($_)     foreach @{$unified_info{programs}};
+ doscript($_)  foreach @{$unified_info{scripts}};
 
  # Finally, should there be any applicable BEGINRAW/ENDRAW sections,
  # they are added here.
- $OUT .= $_."\n" foreach(@{$unified_info{rawlines}});
+ $OUT .= $_."\n" foreach @{$unified_info{rawlines}};
 -}
diff --git a/Configure b/Configure
index c1b63e8..ef5ff9f 100755
--- a/Configure
+++ b/Configure
@@ -743,9 +743,9 @@ while (@tocheckfor) {
     while (@cascade_copy) {
 	my ($test, $descendents) = (shift @cascade_copy, shift @cascade_copy);
 	if (ref($test) eq "CODE" ? $test->() : defined($disabled{$test})) {
-	    map {
+	    foreach(grep { !defined($disabled{$_}) } @$descendents) {
 		$new_tocheckfor{$_} = 1; $disabled{$_} = "forced";
-	    } grep { !defined($disabled{$_}) } @$descendents;
+	    }
 	}
     }
     @tocheckfor = (keys %new_tocheckfor);
@@ -2128,12 +2128,12 @@ sub resolve_config {
 	    # the config that had it.
 	    delete $inherited_config{template};
 
-	    map {
+	    foreach (keys %inherited_config) {
 		if (!$combined_inheritance{$_}) {
 		    $combined_inheritance{$_} = [];
 		}
 		push @{$combined_inheritance{$_}}, $inherited_config{$_};
-	    } keys %inherited_config;
+	    }
 	}
     }
 
@@ -2415,7 +2415,7 @@ sub quotify {
     my $processor =
 	defined($processors{$for}) ? $processors{$for} : sub { shift; };
 
-    map { $processor->($_); } @_;
+    return map { $processor->($_); } @_;
 }
 
 # collect_from_file($filename, $line_concat_cond_re, $line_concat)


More information about the openssl-commits mailing list