[libmoo-perl] 28/43: fix moosify merging

gregor herrmann gregoa at debian.org
Mon Dec 26 17:56:15 UTC 2016


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libmoo-perl.

commit 1768e8355e222c85a6324ef3f174ecf814c12fad
Author: Graham Knop <haarg at haarg.org>
Date:   Fri Dec 9 01:56:07 2016 -0500

    fix moosify merging
---
 lib/Method/Generate/Accessor.pm | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lib/Method/Generate/Accessor.pm b/lib/Method/Generate/Accessor.pm
index 3918cbc..2f81458 100644
--- a/lib/Method/Generate/Accessor.pm
+++ b/lib/Method/Generate/Accessor.pm
@@ -256,15 +256,18 @@ sub merge_specs {
   my $spec = shift @specs;
   for my $old_spec (@specs) {
     foreach my $key (keys %$old_spec) {
-      next
-        if $key eq 'handles' || exists $spec->{$key};
-      $spec->{$key}
-        = $key eq 'moosify'
-          ? [
-            map { ref $_ eq 'ARRAY' ? @$_ : $_ }
-              ($old_spec->{$key}, $spec->{$key})
-          ]
-        : $old_spec->{$key};
+      if ($key eq 'handles') {
+      }
+      elsif ($key eq 'moosify') {
+        $spec->{$key} = [
+          map { ref $_ eq 'ARRAY' ? @$_ : $_ }
+          grep defined,
+          ($old_spec->{$key}, $spec->{$key})
+        ];
+      }
+      elsif (!exists $spec->{$key}) {
+        $spec->{$key} = $old_spec->{$key};
+      }
     }
   }
   $spec;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoo-perl.git



More information about the Pkg-perl-cvs-commits mailing list