From: Jesse Luehrs Date: Thu, 21 Jan 2010 08:23:05 +0000 (-0600) Subject: don't check class_precedence_list in does, since does_role already does X-Git-Tag: 0.95~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b82ef9c3a749fbbbfc60f6eb6dcf439b2ae450d7;p=gitmo%2FMoose.git don't check class_precedence_list in does, since does_role already does --- diff --git a/Changes b/Changes index 1576ad8..20bd23c 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,11 @@ Also see Moose::Manual::Delta for more details of, and workarounds for, noteworthy changes. + [ENHANCEMENTS] + + * Moose::Object::does no longer checks the entire inheritance tree, since + Moose::Meta::Class::does_role already does this. (doy) + 0.94 Mon, Jan 18, 2010 [API CHANGES] diff --git a/lib/Moose/Object.pm b/lib/Moose/Object.pm index 4779eed..1cd1f6a 100644 --- a/lib/Moose/Object.pm +++ b/lib/Moose/Object.pm @@ -119,11 +119,7 @@ sub does { my $meta = Class::MOP::class_of($self); (defined $role_name) || $meta->throw_error("You must supply a role name to does()"); - foreach my $class ($meta->class_precedence_list) { - my $m = $meta->initialize($class); - return 1 - if $m->can('does_role') && $m->does_role($role_name); - } + return 1 if $meta->can('does_role') && $meta->does_role($role_name); return 0; }