[BUG FIXES]
+ * Stop the natatime method provided by the native Array trait from returning
+ an exhausted iterator when being called with a callback. (Florian Ragwitz)
+
* Make Moose::Meta::TypeConstraint::Class correctly reject RegexpRefs.
(Florian Ragwitz)
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;
};
}