X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FAttribute%2FNative%2FMethodProvider%2FArray.pm;h=74e5249994a084454c36661fd0f786deedf5bad6;hb=ae7820b1b884344a7ee90d94b484ca46459eb7b1;hp=25edbc5beb13a0d74a1b78fc5b20b3c10d97569a;hpb=a6f9a6cd26513ba2457f5b54bab12bee84bca5a1;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 25edbc5..74e5249 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_02'; +our $VERSION = '1.06'; $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