push the accessor inlining code back into the attribute
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Hash / count.pm
index 5057e21..8b56c1d 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 
 use Scalar::Util qw( looks_like_number );
 
-our $VERSION = '1.16';
+our $VERSION = '1.19';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -17,10 +17,10 @@ with 'Moose::Meta::Method::Accessor::Native::Reader' =>
 sub _maximum_arguments { 0 }
 
 sub _return_value {
-    my $self        = shift;
-    my $slot_access = shift;
+    my $self = shift;
+    my ($slot_access) = @_;
 
-    return "scalar keys \%{ $slot_access }";
+    return 'scalar keys %{ (' . $slot_access . ') }';
 }
 
 no Moose::Role;