Catmandu/MultiIterator.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 94.4% 34 / 36 CC 3 SCAR 5.6
CC
3
Cov
100%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Catmandu/Fix/mapping.pm ↑ Summary Catmandu/Fix/substring.pm »
1 package Catmandu::MultiIterator;
2  
3 2 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 our $VERSION = '1.2025';
6  
7 2 ▶use Role::Tiny::With;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 with 'Catmandu::Iterable';
11  
12 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
13 1 my ($class, @iterators) = @_;
14 1 my $self = \@iterators;
15 1 bless $self, $class;
16 }
17  
18 1 ▶sub generator {
Subroutine generator: called CC=1 SCAR=0.0
Pod undocumented
19 1 my ($self) = @_;
20 7 ▶ sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
21 7 state $generators = [map {$_->generator} @$self];
22 7 ▶ while (@$generators) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$generators) 8 1 9
23 8 my $data = $generators->[0]->();
24 8 ▶ return $data if defined $data;
Branch: 1 branch
BranchTrueFalseTotal
if defined $data 6 2 8
25 2 shift @$generators;
26 }
27 1 return;
28 1 };
29 }
30  
31 2 1;
32  
33 __END__
« Catmandu/Fix/mapping.pm ↑ Summary Catmandu/Fix/substring.pm »