refactoring the duplicated vars
Tokuhiro Matsuno [Fri, 3 Apr 2009 02:47:44 +0000 (11:47 +0900)]
lib/Mouse/Meta/Method/Accessor.pm

index 5f0058d..ba46cbd 100644 (file)
@@ -91,8 +91,7 @@ sub generate_accessor_method_inline {
     }
 
     if ($should_deref) {
-        my $type_constraint = $attribute->{type_constraint};
-        if (ref($type_constraint) && $type_constraint->name eq 'ArrayRef') {
+        if (ref($constraint) && $constraint->name eq 'ArrayRef') {
             $accessor .= 'if (wantarray) {
                 return @{ '.$self.'->{'.$key.'} || [] };
             }';