Skip to content

Commit

Permalink
Merge pull request #354 from LibreCat/iterator_once
Browse files Browse the repository at this point in the history
use generator only once in importer
  • Loading branch information
nics committed Oct 18, 2018
2 parents 1c65cba + b2d4293 commit 909a5c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Catmandu/Importer.pm
Expand Up @@ -19,6 +19,11 @@ with 'Catmandu::Serializer';

around generator => sub {
my ($orig, $self) = @_;

return sub {} if $self->{_gen_created};

$self->{_gen_created} = 1;

my $generator = $orig->($self);

if (my $fixer = $self->_fixer) {
Expand Down

0 comments on commit 909a5c5

Please sign in to comment.