X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FMethodProvider%2FArray.pm;h=4bbba4ba7a074eb32957f526a84cd8313a56ec51;hb=6b2f825e73f66af279fa9e0802bc06a0094e5e89;hp=b44a692e311ed406454b5f016fb8f490db9d9667;hpb=26a08c157f47d613aab9376a85512ae73ec34482;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 b44a692..4bbba4b 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.93_01'; +our $VERSION = '1.11'; $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