From: Stevan Little Date: Sat, 22 Apr 2006 00:52:13 +0000 (+0000) Subject: stuff X-Git-Tag: 0_26~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=adfe5cc9afd16c322810fcbed45d3c1c69361d57;p=gitmo%2FClass-MOP.git stuff --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 1dd30eb..9c154e3 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -237,6 +237,10 @@ sub class_precedence_list { ( $self->name, map { + # OPTIMIZATION NOTE: + # we grab the metaclass from the %METAS + # hash here to save the initialize() call + # if we can, but it is not always possible ($METAS{$_} || $self->initialize($_))->class_precedence_list() } $self->superclasses() ); @@ -532,7 +536,10 @@ sub compute_all_applicable_attributes { next if $seen_class{$class}; $seen_class{$class}++; # fetch the meta-class ... - my $meta = ($METAS{$class} || $self->initialize($class)); + # OPTIMIZATION NOTE: + # we grab the metaclass from the %METAS + # hash here to save the initialize() call + my $meta = $METAS{$class}; foreach my $attr_name ($meta->get_attribute_list()) { next if exists $seen_attr{$attr_name}; $seen_attr{$attr_name}++;