From: Tokuhiro Matsuno Date: Fri, 3 Apr 2009 02:47:44 +0000 (+0900) Subject: refactoring the duplicated vars X-Git-Tag: 0.20~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ae8a0d7aaaa0627218d5026a013fb70113cce5a;p=gitmo%2FMouse.git refactoring the duplicated vars --- diff --git a/lib/Mouse/Meta/Method/Accessor.pm b/lib/Mouse/Meta/Method/Accessor.pm index 5f0058d..ba46cbd 100644 --- a/lib/Mouse/Meta/Method/Accessor.pm +++ b/lib/Mouse/Meta/Method/Accessor.pm @@ -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.'} || [] }; }';