line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Enumerator::Product; |
2
|
5
|
|
|
5
|
|
27
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
183
|
|
3
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
211
|
|
4
|
5
|
|
|
5
|
|
29
|
use base qw/Data::Enumerator::Base/; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
2017
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub __flatten{ |
7
|
8402
|
|
|
8402
|
|
10338
|
my ( $array ) = @_; |
8
|
8402
|
100
|
|
|
|
26829
|
return $array unless ref $array; |
9
|
4100
|
50
|
|
|
|
9814
|
return $array unless ref $array eq 'ARRAY'; |
10
|
4100
|
|
|
|
|
10929
|
return @$array; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub iterator { |
14
|
30
|
|
|
30
|
0
|
43
|
my ( $self ) = @_; |
15
|
30
|
|
|
|
|
34
|
my ( $a,$b ) = @{ $self->object }; |
|
30
|
|
|
|
|
90
|
|
16
|
30
|
|
|
|
|
93
|
my $iter_a = $a->iterator; |
17
|
30
|
|
|
|
|
86
|
my $iter_b = $b->iterator; |
18
|
30
|
|
|
|
|
68
|
my $value_a = $iter_a->(); |
19
|
30
|
|
|
|
|
41
|
my $iterator;$iterator = sub { |
20
|
4226
|
|
|
4226
|
|
5072
|
while(1){ |
21
|
5100
|
|
|
|
|
11967
|
my $value_b = $iter_b->(); |
22
|
5100
|
100
|
|
|
|
15364
|
if( $self->is_last( $value_a )){ |
23
|
|
|
|
|
|
|
# aが最後までいったら終了 |
24
|
25
|
|
|
|
|
105
|
return $self->LAST; |
25
|
|
|
|
|
|
|
} |
26
|
5075
|
100
|
|
|
|
15130
|
if( $self->is_last($value_b)){ |
27
|
|
|
|
|
|
|
# 最後まで行ったら、iterator再生成 |
28
|
874
|
|
|
|
|
2391
|
$iter_b = $b->iterator; |
29
|
|
|
|
|
|
|
# aを次の値にする |
30
|
874
|
|
|
|
|
15303
|
$value_a = $iter_a->(); |
31
|
|
|
|
|
|
|
# この条件でもう一度 |
32
|
874
|
|
|
|
|
2006
|
next; |
33
|
|
|
|
|
|
|
} |
34
|
4201
|
|
|
|
|
8738
|
return [__flatten($value_a),__flatten($value_b)]; |
35
|
|
|
|
|
|
|
} |
36
|
30
|
|
|
|
|
222
|
}; |
37
|
30
|
|
|
|
|
136
|
return $iterator; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |