From: Yuval Kogman Date: Sun, 10 Aug 2008 20:25:04 +0000 (+0000) Subject: don't use compute_all_applicable_methods anymore X-Git-Tag: 0_55_01~44 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b82ee4f2247e7a324b7c5456586f01847cfb60e;p=gitmo%2FMoose.git don't use compute_all_applicable_methods anymore --- diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 09cf679..2334770 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -682,9 +682,9 @@ sub _get_delegate_method_list { my $self = shift; my $meta = $self->_find_delegate_metaclass; if ($meta->isa('Class::MOP::Class')) { - return map { $_->{name} } # NOTE: !never! delegate &meta - grep { $_->{class} ne 'Moose::Object' && $_->{name} ne 'meta' } - $meta->compute_all_applicable_methods; + return map { $_->name } # NOTE: !never! delegate &meta + grep { $_->package_name ne 'Moose::Object' && $_->name ne 'meta' } + $meta->get_all_methods; } elsif ($meta->isa('Moose::Meta::Role')) { return $meta->get_method_list; diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index 5bccc5a..3546138 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -151,10 +151,10 @@ sub add_method_modifier { my $add_modifier_method = 'add_' . $modifier_name . '_method_modifier'; if ( my $method_modifier_type = ref( @{$args}[0] ) ) { if ( $method_modifier_type eq 'Regexp' ) { - my @all_methods = $meta->compute_all_applicable_methods; + my @all_methods = $meta->get_all_methods; my @matched_methods - = grep { $_->{name} =~ @{$args}[0] } @all_methods; - $meta->$add_modifier_method( $_->{name}, $code ) + = grep { $_->name =~ @{$args}[0] } @all_methods; + $meta->$add_modifier_method( $_->name, $code ) for @matched_methods; } } diff --git a/t/020_attributes/011_more_attr_delegation.t b/t/020_attributes/011_more_attr_delegation.t index f331a05..66942a7 100644 --- a/t/020_attributes/011_more_attr_delegation.t +++ b/t/020_attributes/011_more_attr_delegation.t @@ -201,7 +201,7 @@ ok( !$p->can("child_b_method_2"), "but not ChildB's unspecified siblings" ); ok( !$p->can($_), "none of ChildD's methods ($_)" ) - for grep { /^child/ } map { $_->{name} } ChildD->meta->compute_all_applicable_methods(); + for grep { /^child/ } map { $_->name } ChildD->meta->get_all_methods(); can_ok( $p, "child_c_method_3_la" ); can_ok( $p, "child_c_method_4_la" );