From: gfx Date: Fri, 25 Sep 2009 12:42:15 +0000 (+0900) Subject: Tiny tweaks suggested by NYTProf X-Git-Tag: 0.35~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5fd0bdcff27d34da1708e95dab8eba97d80aa492;p=gitmo%2FMouse.git Tiny tweaks suggested by NYTProf --- diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index f71c60c..cef3e59 100755 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -102,7 +102,7 @@ sub _code_is_mine { # taken from Class::MOP::Class my ( $code_package, $code_name ) = get_code_info($code); - return $code_package && $code_package eq $self->name + return $code_package && $code_package eq $self->{package} || ( $code_package eq 'constant' && $code_name eq '__ANON__' ); } @@ -110,7 +110,8 @@ sub has_method { my($self, $method_name) = @_; return 1 if $self->{methods}->{$method_name}; - my $code = $self->name->can($method_name); + + my $code = $self->{package}->can($method_name); return $code && $self->_code_is_mine($code); }