[openssl-commits] [tools] master update

Richard Levitte levitte at openssl.org
Wed Jun 14 11:42:03 UTC 2017


The branch master has been updated
       via  200f98e598aa4563114d2b98b93e7c6ffdc969de (commit)
      from  97da7e34670fbba78ae41c1bafe1b81a1f02a1a6 (commit)


- Log -----------------------------------------------------------------
commit 200f98e598aa4563114d2b98b93e7c6ffdc969de
Author: Richard Levitte <richard at levitte.org>
Date:   Wed Jun 14 13:41:07 2017 +0200

    OpenSSL::Query: better array processing

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

Summary of changes:
 OpenSSL-Query/lib/OpenSSL/Query.pm | 32 ++++++++++++--------------------
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/OpenSSL-Query/lib/OpenSSL/Query.pm b/OpenSSL-Query/lib/OpenSSL/Query.pm
index d7a2338..f8bd82c 100644
--- a/OpenSSL-Query/lib/OpenSSL/Query.pm
+++ b/OpenSSL-Query/lib/OpenSSL/Query.pm
@@ -78,14 +78,11 @@ sub _perform {
   my $self = shift;
   my $type = shift;
   my $sub = shift;
-  my $opts = shift;
-
-  croak "\$opts MUST be a HASHref" unless ref($opts) eq "HASH";
 
   my @errors = ();
   foreach (@{$self->{$type}}) {
-    my @result = eval { $sub->($_, $opts, @_) };
-    return @result unless $@;
+    my @result = eval { $sub->($_, @_); };
+    return wantarray ? @result : $result[0] unless $@;
     push @errors, $@;
   }
 
@@ -98,11 +95,10 @@ sub find_person {
 
   $self->_perform('person',
 		  sub { my $obj = shift;
-			my $opts = shift;
-			return $opts->{wantarray}
+			return wantarray
 			  ? ($obj->find_person(@_))
 			  : $obj->find_person(@_); },
-		  { wantarray => wantarray }, @_);
+		  @_);
 }
 
 sub find_person_tag {
@@ -110,9 +106,8 @@ sub find_person_tag {
 
   $self->_perform('person',
 		  sub { my $obj = shift;
-			my $opts = shift;
-			$obj->find_person_tag(@_) },
-		  { wantarray => wantarray }, @_);
+			return $obj->find_person_tag(@_) },
+		  @_);
 }
 
 sub is_member_of {
@@ -120,9 +115,8 @@ sub is_member_of {
 
   $self->_perform('person',
 		  sub { my $obj = shift;
-			my $opts = shift;
-			$obj->is_member_of(@_) },
-		  { wantarray => wantarray }, @_);
+			return $obj->is_member_of(@_) },
+		  @_);
 }
 
 # Group methods
@@ -131,9 +125,8 @@ sub members_of {
 
   $self->_perform('person',
 		  sub { my $obj = shift;
-			my $opts = shift;
-			$obj->members_of(@_) },
-		  { wantarray => wantarray }, @_);
+			return $obj->members_of(@_) },
+		  @_);
 }
 
 # Cla methods
@@ -142,9 +135,8 @@ sub has_cla {
 
   $self->_perform('cla',
 		  sub { my $obj = shift;
-			my $opts = shift;
-			$obj->has_cla(@_) },
-		  { wantarray => wantarray }, @_);
+			return $obj->has_cla(@_) },
+		  @_);
 }
 
 1;


More information about the openssl-commits mailing list