From: Yuval Kogman Date: Sun, 10 Aug 2008 18:24:17 +0000 (+0000) Subject: merge the attribute maps in compute_all_applicable_attributes X-Git-Tag: 0_64_01~52 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3ec92caa8d7679fb1a2785c9269598776f3bade9;p=gitmo%2FClass-MOP.git merge the attribute maps in compute_all_applicable_attributes --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index c5075dc..64c1ec4 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -976,17 +976,8 @@ sub get_attribute_list { sub compute_all_applicable_attributes { my $self = shift; - my (@attrs, %seen_attr); - foreach my $class ($self->linearized_isa) { - # fetch the meta-class ... - my $meta = $self->initialize($class); - foreach my $attr_name ($meta->get_attribute_list()) { - next if exists $seen_attr{$attr_name}; - $seen_attr{$attr_name}++; - push @attrs => $meta->get_attribute($attr_name); - } - } - return @attrs; + my %attrs = map { %{ $self->initialize($_)->get_attribute_map } } reverse $self->linearized_isa; + return values %attrs; } sub find_attribute_by_name {