From: Graham Knop Date: Tue, 14 Jan 2014 12:41:35 +0000 (-0500) Subject: small style cleanup X-Git-Tag: v1.003003~31 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=56efcee2e1d28941148ead2612dec38a9d6cd82b;p=gitmo%2FRole-Tiny.git small style cleanup --- diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 6f3e3d1..e1397e2 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -396,15 +396,16 @@ sub _install_single_modifier { my $FALLBACK = sub { 0 }; sub _install_does { my ($me, $to) = @_; - + # only add does() method to classes return if $me->is_role($to); - + # add does() only if they don't have one *{_getglob "${to}::does"} = \&does_role unless $to->can('does'); - - return if ($to->can('DOES') and $to->can('DOES') != (UNIVERSAL->can('DOES') || 0)); - + + return + if $to->can('DOES') and $to->can('DOES') != (UNIVERSAL->can('DOES') || 0); + my $existing = $to->can('DOES') || $to->can('isa') || $FALLBACK; my $new_sub = sub { my ($proto, $role) = @_;