X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FMethodProvider%2FArray.pm;h=974f46861b5df1b7786092c9b13aee0e2996ecb1;hb=55d05fb16429c2150b5337b1a0130ae334e129d0;hp=a2d3770a836a15ac9b580326be28afdfd805b653;hpb=8b09d5c3b7d7e44b2feb8b9485d8423c58b09b16;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm b/lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm index a2d3770..974f468 100644 --- a/lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm +++ b/lib/Moose/Meta/Attribute/Native/MethodProvider/Array.pm @@ -4,7 +4,7 @@ use Moose::Role; use List::Util; use List::MoreUtils; -our $VERSION = '0.95'; +our $VERSION = '1.12'; $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; }; }