From: Yuval Kogman Date: Sun, 10 Aug 2008 19:08:15 +0000 (+0000) Subject: recalculating the method map updates the cache flag X-Git-Tag: 0_55_01~45 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5c56b0f3a8447e481b0b9d937772de1b83c4182;p=gitmo%2FMoose.git recalculating the method map updates the cache flag --- diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 93b37ee..dcc2e09 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -169,11 +169,14 @@ sub construct_instance { sub get_method_map { my $self = shift; - if (defined $self->{'_package_cache_flag'} && - $self->{'_package_cache_flag'} == Class::MOP::check_package_cache_flag($self->meta->name)) { + my $current = Class::MOP::check_package_cache_flag($self->name); + + if (defined $self->{'_package_cache_flag'} && $self->{'_package_cache_flag'} == $current) { return $self->{'methods'}; } + $self->{_package_cache_flag} = $current; + my $map = $self->{'methods'}; my $class_name = $self->name;