From: Matt S Trout Date: Thu, 29 Mar 2012 19:53:46 +0000 (+0000) Subject: remove redundant code in create_class_with_roles X-Git-Tag: v1.000000~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=29dde8ba9746fc25b5463a1fe3a0a8ce0cc08305;p=gitmo%2FRole-Tiny.git remove redundant code in create_class_with_roles --- diff --git a/Changes b/Changes index 1781477..9cb3e0f 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - Remove redundant code in create_class_with_roles - Minor doc fix to does_role - Split Role::Tiny out into its own dist diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 40f8d0b..6c6733d 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -114,7 +114,7 @@ sub create_class_with_roles { foreach my $role (@roles) { _load_module($role); - die "${role} is not a Role::Tiny" unless my $info = $INFO{$role}; + die "${role} is not a Role::Tiny" unless $INFO{$role}; } if ($] >= 5.010) { @@ -127,7 +127,7 @@ sub create_class_with_roles { *{_getglob("${new_name}::ISA")} = [ @composable, $superclass ]; - my @info = map +($INFO{$_} ? $INFO{$_} : ()), @roles; + my @info = map $INFO{$_}, @roles; $me->_check_requires( $new_name, $compose_name,