X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FC3.pm;h=3055c179d4002a8d9012ba25fdeed44330aeedcc;hb=f7facd7b73c20ba048f0f6c0baea399ba8db10ed;hp=6ca39992587b97173bd614fae15dac27b923eb91;hpb=680100b1744c65ae1a1dc2da8522731aa197d75b;p=gitmo%2FClass-C3.git diff --git a/lib/Class/C3.pm b/lib/Class/C3.pm index 6ca3999..3055c17 100644 --- a/lib/Class/C3.pm +++ b/lib/Class/C3.pm @@ -6,7 +6,7 @@ use warnings; use Scalar::Util 'blessed'; -our $VERSION = '0.06'; +our $VERSION = '0.07'; # this is our global stash of both # MRO's and method dispatch tables @@ -22,7 +22,7 @@ our $VERSION = '0.06'; # has_overload_fallback => (1 | 0) # } # -my %MRO; +our %MRO; # use these for debugging ... sub _dump_MRO_table { %MRO } @@ -36,7 +36,7 @@ sub import { return if $TURN_OFF_C3; # make a note to calculate $class # during INIT phase - $MRO{$class} = undef; + $MRO{$class} = undef unless exists $MRO{$class}; } ## initializers @@ -205,7 +205,7 @@ use warnings; use Scalar::Util 'blessed'; -our $VERSION = '0.03'; +our $VERSION = '0.04'; our %METHOD_CACHE; @@ -228,6 +228,8 @@ sub method { no strict 'refs'; my $found; foreach my $class (@MRO) { + next if (defined $Class::C3::MRO{$class} && + defined $Class::C3::MRO{$class}{methods}{$label}); last if (defined ($found = *{$class . '::' . $label}{CODE})); }