From: Dave Rolsky Date: Tue, 2 Dec 2008 23:01:50 +0000 (+0000) Subject: Get class name into a local var earlier X-Git-Tag: 0.71_01~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9f772b4ebbd5d9d16ab30558dfca9c28951bf38;p=gitmo%2FClass-MOP.git Get class name into a local var earlier --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 84c83be..b5eda57 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -315,8 +315,10 @@ sub instance_metaclass { $_[0]->{'instance_metaclass'} } # this is a prime canidate for conversion to XS sub get_method_map { my $self = shift; - - my $current = Class::MOP::check_package_cache_flag($self->name); + + my $class_name = $self->name; + + my $current = Class::MOP::check_package_cache_flag($class_name); if (defined $self->{'_package_cache_flag'} && $self->{'_package_cache_flag'} == $current) { return $self->{'methods'} ||= {}; @@ -324,9 +326,8 @@ sub get_method_map { $self->{_package_cache_flag} = $current; - my $map = $self->{'methods'} ||= {}; + my $map = $self->{'methods'} ||= {}; - my $class_name = $self->name; my $method_metaclass = $self->method_metaclass; my %all_code = $self->get_all_package_symbols('CODE');