X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FClass%2FMOP%2FMixin%2FHasMethods.pm;h=34a66b4b6d65a6a5ac8fdaa5ec72649a09f8dd6b;hb=6038ad58fc973409650490c9dcc0c4302a084044;hp=3cf042dfd58a3993366ddcb74d489052b4a2d732;hpb=d765b92d62f0992a41d37a17c60f8af3f8c17525;p=gitmo%2FClass-MOP.git diff --git a/lib/Class/MOP/Mixin/HasMethods.pm b/lib/Class/MOP/Mixin/HasMethods.pm index 3cf042d..34a66b4 100644 --- a/lib/Class/MOP/Mixin/HasMethods.pm +++ b/lib/Class/MOP/Mixin/HasMethods.pm @@ -110,9 +110,8 @@ sub get_method { # added via roles or some other such bizareness. Honestly, I don't totally # understand this, but returning the entry works, and keeps various MX # modules from blowing up. - DR - return $map_entry if blessed $map_entry && !$code; - - return $map_entry if blessed $map_entry && $map_entry->body == $code; + return $map_entry + if blessed $map_entry && ( !$code || $map_entry->body == $code ); unless ($map_entry) { return unless $code && $self->_code_is_mine($code);