Show
Ignore:
Timestamp:
04/03/08 06:57:15 (5 years ago)
Author:
yappo
Message:

lang/perl/Class-Component: これはちょっと微妙すぎる

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Class-Component/trunk/lib/Class/Component/Plugin.pm

    r8696 r8707  
    6060 
    6161    my $is_attribute_detect_cache = $self->is_class_component_plugin_attribute_detect_cache; 
     62    my $class = ref $self; 
    6263    for my $data (@{ $self->__methods_cache }) { 
    6364        for my $attr (@{ $data->{attrs} }) { 
    6465            my($key, $value); 
    65             my $cache_key = sprintf '%s::%s', ref($self), $attr; 
    66             if ($is_attribute_detect_cache && $attribute_detect_cache{$cache_key}) { 
    67                 ($key, $value) = @{ $attribute_detect_cache{$cache_key} }; 
     66            my $cache_key = "$class\::$attr"; 
     67            my $attr_res  = $attribute_detect_cache{$cache_key}; 
     68            if ($is_attribute_detect_cache && $attr_res) { 
     69                ($key, $value) = ( $attr_res->[0], $attr_res->[1] ); 
    6870            } else { 
    6971                next unless ($key, $value) = $self->class_component_plugin_attribute_detect($attr, $cache_key);