line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Range::Compare::Stream::Iterator::Compare::LayerCake; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
1099
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
4
|
use base qw(Data::Range::Compare::Stream::Iterator::Compare::Asc); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
677
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
18
|
|
|
18
|
0
|
8503
|
my ($class,%args)=@_; |
11
|
18
|
|
|
|
|
69
|
%args=(ignore_empty=>0,,%args); |
12
|
18
|
|
|
|
|
105
|
my $self=$class->SUPER::new(%args); |
13
|
|
|
|
|
|
|
|
14
|
18
|
|
|
|
|
63
|
return $self; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get_next { |
18
|
94
|
|
|
94
|
1
|
39058
|
my ($self)=@_; |
19
|
|
|
|
|
|
|
|
20
|
94
|
100
|
|
|
|
300
|
if(defined($self->{filter})) { |
21
|
2
|
|
|
|
|
3
|
my $result=$self->{next_result}; |
22
|
2
|
|
|
|
|
4
|
delete $self->{next_result}; |
23
|
2
|
|
|
|
|
7
|
return $result; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
92
|
100
|
|
|
|
244
|
if($self->{ignore_full}) { |
27
|
4
|
|
|
|
|
8
|
my $result=$self->{next_result}; |
28
|
4
|
|
|
|
|
8
|
delete $self->{next_result}; |
29
|
4
|
|
|
|
|
14
|
return $result; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
88
|
50
|
66
|
|
|
536
|
return $self->SUPER::get_next unless $self->{ignore_empty} or $self->{empty_only}; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
12
|
|
|
|
|
57
|
my $result=$self->SUPER::get_next; |
37
|
|
|
|
|
|
|
|
38
|
12
|
|
66
|
|
|
47
|
while($result->is_empty and $self->has_next) { |
39
|
2
|
|
|
|
|
8
|
$result=$self->SUPER::get_next; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
12
|
|
|
|
|
40
|
return $result; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub prepare { |
47
|
44
|
|
|
44
|
0
|
70
|
my ($self)=@_; |
48
|
|
|
|
|
|
|
|
49
|
44
|
100
|
|
|
|
153
|
return if $self->prepared; |
50
|
|
|
|
|
|
|
|
51
|
17
|
|
|
|
|
76
|
$self->SUPER::prepare; |
52
|
17
|
100
|
|
|
|
56
|
if(defined($self->{filter})) { |
53
|
1
|
|
|
|
|
3
|
my $filter=$self->{filter}; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
1
|
|
|
|
|
4
|
while($self->SUPER::has_next) { |
57
|
1
|
|
|
|
|
5
|
my $result=$self->SUPER::get_next; |
58
|
1
|
50
|
|
|
|
8
|
if($filter->($result)) { |
59
|
1
|
|
|
|
|
2
|
$self->{next_result}=$result; |
60
|
1
|
|
|
|
|
2
|
return 1; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
0
|
|
|
|
|
0
|
delete $self->{next_result}; |
64
|
0
|
|
|
|
|
0
|
return 0; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub has_next { |
71
|
43
|
|
|
43
|
0
|
19092
|
my ($self)=@_; |
72
|
|
|
|
|
|
|
|
73
|
43
|
|
|
|
|
114
|
$self->prepare; |
74
|
|
|
|
|
|
|
|
75
|
43
|
100
|
|
|
|
209
|
if(defined($self->{filter})) { |
|
|
100
|
|
|
|
|
|
76
|
3
|
|
|
|
|
5
|
my $filter=$self->{filter}; |
77
|
|
|
|
|
|
|
|
78
|
3
|
100
|
|
|
|
12
|
return 1 if defined($self->{next_result}); |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
2
|
|
|
|
|
9
|
while($self->SUPER::has_next) { |
82
|
4
|
|
|
|
|
12
|
my $result=$self->SUPER::get_next; |
83
|
4
|
100
|
|
|
|
11
|
if($filter->($result)) { |
84
|
1
|
|
|
|
|
4
|
$self->{next_result}=$result; |
85
|
1
|
|
|
|
|
5
|
return 1; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
} |
88
|
1
|
|
|
|
|
3
|
delete $self->{next_result}; |
89
|
1
|
|
|
|
|
4
|
return 0; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
} elsif($self->{ignore_full}) { |
92
|
6
|
50
|
|
|
|
23
|
return 1 if defined($self->{next_result}); |
93
|
|
|
|
|
|
|
|
94
|
6
|
100
|
|
|
|
27
|
return 0 unless $self->SUPER::has_next; |
95
|
|
|
|
|
|
|
|
96
|
5
|
|
|
|
|
22
|
my $result=$self->SUPER::get_next; |
97
|
5
|
|
|
|
|
24
|
while($result->is_full) { |
98
|
|
|
|
|
|
|
|
99
|
4
|
100
|
|
|
|
17
|
return 0 unless $self->SUPER::has_next; |
100
|
3
|
|
|
|
|
10
|
$result=$self->SUPER::get_next; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
4
|
|
|
|
|
14
|
$self->{next_result}=$result; |
105
|
4
|
50
|
|
|
|
22
|
return defined($result) ? 1 : 0; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
} else { |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# back off and use the parrent class internals |
110
|
34
|
|
|
|
|
127
|
return $self->SUPER::has_next; |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
1; |