Version 1.04
[gitmo/Moose.git] / lib / Moose / Meta / Attribute / Native / MethodProvider / Array.pm
index de88024..790cbe1 100644 (file)
@@ -4,7 +4,7 @@ use Moose::Role;
 use List::Util;
 use List::MoreUtils;
 
-our $VERSION = '0.93';
+our $VERSION = '1.04';
 $VERSION = eval $VERSION;
 our $AUTHORITY = 'cpan:STEVAN';
 
@@ -346,12 +346,13 @@ sub natatime : method {
     return sub {
         my ( $instance, $n, $f ) = @_;
         my $it = List::MoreUtils::natatime($n, @{ $reader->($instance) });
-        if ($f) {
-            while (my @vals = $it->()) {
-                $f->(@vals);
-            }
+        return $it unless $f;
+
+        while (my @vals = $it->()) {
+            $f->(@vals);
         }
-        $it;
+
+        return;
     };
 }
 
@@ -363,7 +364,7 @@ __END__
 
 =head1 NAME
 
-Moose::Meta::Attribute::Native::MethodProvider::Array
+Moose::Meta::Attribute::Native::MethodProvider::Array - role providing method generators for Array trait
 
 =head1 DESCRIPTION