From: Shawn M Moore Date: Sat, 28 Mar 2009 21:41:59 +0000 (-0400) Subject: optimized RoleName class_of X-Git-Tag: 0.73_01~36^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9df65fdba42d26cf7411ce9f40cc93e2254582a1;p=gitmo%2FMoose.git optimized RoleName class_of --- diff --git a/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm b/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm index 7999895..a8f2510 100644 --- a/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm +++ b/lib/Moose/Util/TypeConstraints/OptimizedConstraints.pm @@ -38,8 +38,8 @@ sub ClassName { } sub RoleName { - ClassName($_[0]) - && (($_[0]->can('meta') || return)->($_[0]) || return)->isa('Moose::Meta::Role') + ClassName($_[0]) + && (Class::MOP::class_of($_[0]) || return)->isa('Moose::Meta::Role') } # NOTE: