From: Dave Rolsky Date: Thu, 19 Aug 2010 14:02:06 +0000 (-0500) Subject: Only get ISA once in superclasses method X-Git-Tag: 1.05~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9fcd76fdf3de5a03e208417f4fe63741d5859e90;p=gitmo%2FClass-MOP.git Only get ISA once in superclasses method --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index b1678a9..10c5d5e 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -762,10 +762,13 @@ sub get_all_attributes { sub superclasses { my $self = shift; - my $var_spec = { sigil => '@', type => 'ARRAY', name => 'ISA' }; + + my $isa = $self->get_package_symbol( + { sigil => '@', type => 'ARRAY', name => 'ISA' } ); + if (@_) { my @supers = @_; - @{$self->get_package_symbol($var_spec)} = @supers; + @{$isa} = @supers; # NOTE: # on 5.8 and below, we need to call @@ -784,7 +787,8 @@ sub superclasses { $self->_check_metaclass_compatibility(); $self->_superclasses_updated(); } - @{$self->get_package_symbol($var_spec)}; + + return @{$isa}; } sub _superclasses_updated {